Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 338
0.00% covered (danger)
0.00%
0 / 250
0.00% covered (danger)
0.00%
0 / 2402
0.00% covered (danger)
0.00%
0 / 15
CRAP
n/a
0 / 0
CTABaselineSpliceChecks
0.00% covered (danger)
0.00%
0 / 34
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
30
checkSequentialSwSetMProfile
0.00% covered (danger)
0.00%
0 / 18
0.00% covered (danger)
0.00%
0 / 20
0.00% covered (danger)
0.00%
0 / 20
0.00% covered (danger)
0.00%
0 / 1
72
checkDiscontinuousSplicePoints
0.00% covered (danger)
0.00%
0 / 28
0.00% covered (danger)
0.00%
0 / 15
0.00% covered (danger)
0.00%
0 / 17
0.00% covered (danger)
0.00%
0 / 1
72
checkEncryptionChangeSplicePoint
0.00% covered (danger)
0.00%
0 / 33
0.00% covered (danger)
0.00%
0 / 38
0.00% covered (danger)
0.00%
0 / 2106
0.00% covered (danger)
0.00%
0 / 1
306
getEncrytionScheme
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
12
checkSampleEntryChangeSplicePoint
0.00% covered (danger)
0.00%
0 / 16
0.00% covered (danger)
0.00%
0 / 13
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 1
42
getSdType
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
20
checkDefaultKIDChangeSplicePoint
0.00% covered (danger)
0.00%
0 / 22
0.00% covered (danger)
0.00%
0 / 15
0.00% covered (danger)
0.00%
0 / 20
0.00% covered (danger)
0.00%
0 / 1
72
checkTrackIDChangeSplicePoint
0.00% covered (danger)
0.00%
0 / 20
0.00% covered (danger)
0.00%
0 / 15
0.00% covered (danger)
0.00%
0 / 20
0.00% covered (danger)
0.00%
0 / 1
72
checkTimeScaleChangeSplicePoint
0.00% covered (danger)
0.00%
0 / 20
0.00% covered (danger)
0.00%
0 / 15
0.00% covered (danger)
0.00%
0 / 20
0.00% covered (danger)
0.00%
0 / 1
72
checkFragrmentOverlapSplicePoint
0.00% covered (danger)
0.00%
0 / 36
0.00% covered (danger)
0.00%
0 / 23
0.00% covered (danger)
0.00%
0 / 62
0.00% covered (danger)
0.00%
0 / 1
132
checkPicAspectRatioSplicePoint
0.00% covered (danger)
0.00%
0 / 22
0.00% covered (danger)
0.00%
0 / 14
0.00% covered (danger)
0.00%
0 / 14
0.00% covered (danger)
0.00%
0 / 1
72
checkFrameRateSplicePoint
0.00% covered (danger)
0.00%
0 / 21
0.00% covered (danger)
0.00%
0 / 17
0.00% covered (danger)
0.00%
0 / 20
0.00% covered (danger)
0.00%
0 / 1
90
getFrameRate
0.00% covered (danger)
0.00%
0 / 31
0.00% covered (danger)
0.00%
0 / 28
0.00% covered (danger)
0.00%
0 / 64
0.00% covered (danger)
0.00%
0 / 1
240
checkAudioChannelSplicePoint
0.00% covered (danger)
0.00%
0 / 22
0.00% covered (danger)
0.00%
0 / 14
0.00% covered (danger)
0.00%
0 / 14
0.00% covered (danger)
0.00%
0 / 1
72
1<?php
2
3/* 
4 * To change this license header, choose License Headers in Project Properties.
5 * To change this template file, choose Tools | Templates
6 * and open the template in the editor.
7 */
8
9function CTABaselineSpliceChecks()
10{
11    global $MediaProfDatabase, $session_dir, $string_info, $progress_xml, $progress_report, $adaptation_set_template,$reprsentation_template, $CTAspliceConstraitsLog;
12    $opfile="";
13    if(!($opfile = open_file($session_dir . '/' . $CTAspliceConstraitsLog . '.txt', 'w'))){
14        echo "Error opening/creating SpliceConstraints conformance check file: "."./SpliceConstraints_infofile_ctawave.txt";
15        return;
16    }
17    $error=checkSequentialSwSetMProfile($MediaProfDatabase);
18    fwrite($opfile, $error);
19    $error=checkDiscontinuousSplicePoints($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
20    fwrite($opfile, $error);
21    $error=checkEncryptionChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
22    fwrite($opfile, $error);
23    $error=checkSampleEntryChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
24    fwrite($opfile, $error);
25    $error=checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
26    fwrite($opfile, $error);
27    $error=checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
28    fwrite($opfile, $error);
29    $error=checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
30    fwrite($opfile, $error);
31    $error=checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
32    fwrite($opfile, $error);
33    
34    fclose($opfile);
35    
36    WAVEProgramChecks();
37    
38    $searchfiles = file_get_contents($session_dir.'/'.$CTAspliceConstraitsLog.'.txt');
39    if(strpos($searchfiles, "CTAWAVE check violated") !== FALSE){
40        $progress_xml->Results[0]->addChild('CTAWAVESpliceConstraints', 'error');
41        $file_error[] = $session_dir.'/'.$CTAspliceConstraitsLog.'.html';
42    }
43    elseif(strpos($searchfiles, "Warning") !== FALSE || strpos($searchfiles, "WARNING") !== FALSE){
44        $progress_xml->Results[0]->addChild('CTAWAVESpliceConstraints', 'warning');
45        $file_error[] = $session_dir.'/'.$CTAspliceConstraitsLog.'.html';
46    }
47    else{
48        $progress_xml->Results[0]->addChild('CTAWAVESpliceConstraints', 'noerror');
49        $file_error[] = "noerror";
50    }
51    $progress_xml->asXml(trim($session_dir . '/' . $progress_report));
52    tabulateResults($session_dir.'/'.$CTAspliceConstraitsLog.'.txt', 'Cross');
53    print_console($session_dir.'/'.$CTAspliceConstraitsLog.'.txt', " CTA WAVE Baseline Splice Constraints Results");
54}
55
56function checkSequentialSwSetMProfile($MediaProfDatabase)
57{
58    $errorMsg="";
59    $period_count=sizeof($MediaProfDatabase);
60    //Create an array of media profiles at Sw set level.
61    //If all reps doesnt have same MP, then "unknown" is assigned.
62    for($i=0;$i<$period_count;$i++)
63    {
64        $adapt_count=sizeof($MediaProfDatabase[$i]);
65        for($j=0;$j<$adapt_count;$j++)
66        {
67            $rep_count=sizeof($MediaProfDatabase[$i][$j]);
68            $MediaProf_PeriodAdSet[$i][$j]=$MediaProfDatabase[$i][$j][0];
69            for($k=0;$k<($rep_count-1);$k++)
70            {
71                if($MediaProfDatabase[$i][$j][$k]!==$MediaProfDatabase[$i][$j][$k+1])
72                {
73                    $MediaProf_PeriodAdSet[$i][$j]="unknown";
74                    break;
75                }       
76            }
77        }
78    }
79    
80   //Check the MP at the Sw Set level and raise conformance error.
81    $adapt_count=sizeof($MediaProf_PeriodAdSet[0]);
82    for($i=0;$i<($period_count-1);$i++)
83    {
84        for($j=0;$j<$adapt_count;$j++)
85        {
86            if($MediaProf_PeriodAdSet[$i][$j]!==$MediaProf_PeriodAdSet[$i+1][$j]){
87                $errorMsg="###CTAWAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: Sequential Switching Sets SHALL conform to the same CMAF Media Profile, voilated for Sw set ".$j." between CMAF Presentations ".$i." and  ".($i+1)." with media profiles- '".$MediaProf_PeriodAdSet[$i][$j]."' and '".$MediaProf_PeriodAdSet[$i+1][$j]."' respectively.\n";
88                $errorMsg.="###CTAWAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: Encoding parameters Shall be constrained such that CMAF Fragments of following Switching Set can be decoded by a decoder configured for previous Switching Set without reinitialization, voilated for Sw set ".$j." between CMAF Presentations ".$i." and  ".($i+1)." as Media Profile found are '".$MediaProf_PeriodAdSet[$i][$j]."' and '".$MediaProf_PeriodAdSet[$i+1][$j]."' respectively.\n";
89            }
90        }
91    }
92    return $errorMsg;
93}
94
95function checkDiscontinuousSplicePoints($session_dir, $MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
96{
97    $errorMsg="";
98    $period_count=sizeof($MediaProfDatabase);
99    $adapt_count=sizeof($MediaProfDatabase[0]);
100    for($i=0;$i<($period_count-1);$i++)
101    {
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
103        {
104            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
105            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
106            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
107            if($xml_rep_P1){
108                $moof_len=$xml_rep_P1->getElementsByTagName("moof")->length;
109                if($moof_len>0)
110                {
111                    $tfdt=$xml_rep_P1->getElementsByTagName("tfdt")->item($moof_len-1);
112                    $baseMediaDecodeTime_p1=$tfdt->getAttribute("baseMediaDecodeTime");
113                    $trun=$xml_rep_P1->getElementsByTagName("trun")->item($moof_len-1);
114                    $cummulatedSampleDuration_p1=$trun->getAttribute("cummulatedSampleDuration");
115                    $mdhd=$xml_rep_P1->getElementsByTagName("mdhd")->item(0);
116                    $timescale_1=$mdhd->getAttribute("timescale");
117                }
118            }
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
120            if($xml_rep_P2){
121                $moof_len=$xml_rep_P2->getElementsByTagName("moof")->length;
122                if($moof_len>0)
123                {
124                    $tfdt=$xml_rep_P2->getElementsByTagName("tfdt")->item(0);
125                    $baseMediaDecodeTime_p2=$tfdt->getAttribute("baseMediaDecodeTime");
126                    $mdhd=$xml_rep_P2->getElementsByTagName("mdhd")->item(0);
127                    $timescale_2=$mdhd->getAttribute("timescale");
128                    
129                }
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
131                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: Sequential Switching Sets can be discontinuous, and it is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with baseMediaDecodeTime- ".(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1)." and ".($baseMediaDecodeTime_p2/$timescale_2)." respectively.\n";
132
133                
134            }
135        }
136       
137    }
138    return $errorMsg;
139}
140
141function checkEncryptionChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
142{
143    $errorMsg="";
144    $period_count=sizeof($MediaProfDatabase);
145    $adapt_count=sizeof($MediaProfDatabase[0]);
146    for($i=0;$i<($period_count-1);$i++)
147    {
148       for($adapt=0;$adapt<$adapt_count;$adapt++)
149        {
150            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
151            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
152            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
153            if($xml_rep_P1){
154                $encScheme_p1=getEncrytionScheme($xml_rep_P1);
155
156            }
157           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
158            if($xml_rep_P2){
159                $encScheme_p2=getEncrytionScheme($xml_rep_P2);
160
161            }
162            if($encScheme_p1!=$encScheme_p2 && ($encScheme_p1===0 || $encScheme_p2===0))
163                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: Sequential Switching Sets can change between unencrypted/encrypted at Splice points, it is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with enc scheme ".$encScheme_p1." and ".$encScheme_p1." respectively.\n";
164
165                
166        }   
167    }
168    $encSchemePeriod=array();
169    for($i=0;$i<($period_count);$i++)
170    {
171       $encSchemeAdapt=array();
172       for($adapt=0;$adapt<$adapt_count;$adapt++)
173        {
174            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
175            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
176            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
177            if($xml_rep_P1){
178                $encScheme_p1=getEncrytionScheme($xml_rep_P1);
179                if($encScheme_p1!==0)
180                   array_push($encSchemeAdapt,$encScheme_p1);
181            }       
182        }
183        if(count($encSchemeAdapt)==0)
184            array_push ($encSchemePeriod, 0);
185        else
186            array_push ($encSchemePeriod, array_unique($encSchemeAdapt)[0]);
187    }
188    for($i=0;$i<($period_count-1);$i++)
189    {
190        if($encSchemePeriod[$i]!==$encSchemePeriod[$i+1] && $encSchemePeriod[$i]!==0 && $encSchemePeriod[$i+1]!==0)
191            $errorMsg.="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'WAVE content SHALL contain one CENC Scheme per program', violated between CMAF Presentations ".$i." and  ".($i+1)." contains ".$encSchemePeriod[$i]." and ".$encSchemePeriod[$i+1]." respectively.\n";
192
193    }
194    return $errorMsg;
195}
196
197function getEncrytionScheme($xml)
198{
199     //Check for encrypted tracks
200    if($xml->getElementsByTagName('tenc')->length >0)
201    {   
202        $schm=$xml->getElementsByTagName('schm');
203        if($schm->length>0)
204             return $schm->item(0)->getAttribute('scheme');
205    }
206    else
207        return 0;
208}
209
210function checkSampleEntryChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
211{
212    $errorMsg="";
213    $period_count=sizeof($MediaProfDatabase);
214    $adapt_count=sizeof($MediaProfDatabase[0]);
215    for($i=0;$i<($period_count-1);$i++)
216    {
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
218        {
219            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
220            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
221            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
222            if($xml_rep_P1){
223                $sdType_p1=getSdType($xml_rep_P1);
224
225            }
226           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
227            if($xml_rep_P2){
228                  $sdType_p2=getSdType($xml_rep_P2);
229
230            }
231            if($sdType_p1!=$sdType_p2 )
232                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'Sample entries in Sequential Switching Sets Shall not change sample type at Splice points', but different sample types ".$sdType_p1." and ".$sdType_p2."observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1).".\n";
233
234                
235        }   
236    }
237    return $errorMsg;
238}
239
240function getSdType($xml)
241{
242    $sdType=0;$SampleDescr="";
243    $hdlr=$xml->getElementsByTagName("hdlr")->item(0);
244    $handler_type=$hdlr->getAttribute("handler_type");
245    if($handler_type=="vide")
246        $SampleDescr=$xml->getElementsByTagName("vide_sampledescription")->item(0);
247    elseif($handler_type=="soun")
248        $SampleDescr=$xml->getElementsByTagName("soun_sampledescription")->item(0);
249    if($SampleDescr!=="")
250        $sdType=$SampleDescr->getAttribute("sdType");
251    
252    return $sdType;
253}
254
255function checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
256{
257    $errorMsg="";
258    $period_count=sizeof($MediaProfDatabase);
259    $adapt_count=sizeof($MediaProfDatabase[0]);
260    $defaultKID_p1=0;$defaultKID_p2=0;
261    $errorMsg="";
262    for($i=0;$i<($period_count-1);$i++)
263    {
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
265        {
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
270                $tenc=$xml_rep_P1->getElementsByTagName("tenc");
271                if($tenc->length>0)
272                  $defaultKID_p1=$tenc->item(0)->getAttribute("default_KID");
273               
274            }
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
277                $tenc=$xml_rep_P2->getElementsByTagName("tenc");
278                if($tenc->length>0)
279                  $defaultKID_p2=$tenc->item(0)->getAttribute("default_KID");
280
281            }
282            if($defaultKID_p1!=$defaultKID_p2 )
283                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Default KID can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with values -".$defaultKID_p1." and ".$defaultKID_p2." respectively.\n";
284
285                
286        }   
287    }
288    return $errorMsg;
289}
290function checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
291{
292    $errorMsg="";
293    $period_count=sizeof($MediaProfDatabase);
294    $adapt_count=sizeof($MediaProfDatabase[0]);
295    for($i=0;$i<($period_count-1);$i++)
296    {
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
298        {
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
303                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd");
304                if($tkhd->length>0)
305                  $trackID_p1=$tkhd->item(0)->getAttribute("trackID");
306               
307            }
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
310                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd");
311                if($tkhd->length>0)
312                  $trackID_p2=$tkhd->item(0)->getAttribute("trackID");
313
314            }
315            if($trackID_p1!=$trackID_p2 )
316                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Track_ID can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with TrackID -".$trackID_p1." and ".$trackID_p2." respectively.\n";
317
318                
319        }   
320    }
321    return $errorMsg;
322}
323
324function checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
325{
326    $period_count=sizeof($MediaProfDatabase);
327    $adapt_count=sizeof($MediaProfDatabase[0]);
328    $errorMsg="";
329    for($i=0;$i<($period_count-1);$i++)
330    {
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
332        {
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
337                $mvhd=$xml_rep_P1->getElementsByTagName("mvhd");
338                if($mvhd->length>0)
339                  $timescale_p1=$mvhd->item(0)->getAttribute("timeScale");
340               
341            }
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
344                $mvhd=$xml_rep_P2->getElementsByTagName("mvhd");
345                if($mvhd->length>0)
346                  $timescale_p2=$mvhd->item(0)->getAttribute("timeScale");
347
348            }
349            if($timescale_p1!=$timescale_p2 )
350                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Timescale can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with timescale ".$timescale_p1." and ".$timescale_p1." respectively.\n";
351
352                
353        }   
354    }
355    return $errorMsg;
356}
357
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
364    {
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
366        {
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
383                }
384            }
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
389                {
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
391                }
392                else
393                {
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
408                    $errorMsg.="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not have gaps in WAVE Program presentation time at the Splice point', gap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
409
410                
411        }   
412    }
413    return $errorMsg;
414}
415
416function checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
417{
418    $period_count=sizeof($MediaProfDatabase);
419    $adapt_count=sizeof($MediaProfDatabase[0]);
420    $errorMsg="";
421    for($i=0;$i<($period_count-1);$i++)
422    {
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
424        {
425            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
426            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
427            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
428            if($xml_rep_P1){
429                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd")->item(0);
430                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
431                if($hdlr=="vide")
432                    $par_p1=$tkhd->getAttribute("width")/($tkhd->getAttribute("height"));
433                    
434            }
435            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
436            if($xml_rep_P2){
437                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd")->item(0);
438                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
439                if($hdlr=="vide"){
440                    $par_p2=$tkhd->getAttribute("width")/($tkhd->getAttribute("height"));
441
442            
443                    if($par_p1!=$par_p2)
444                        $errorMsg="###Warning: WAVE Content Spec 2018Ed-Section 7.2.2: 'Picture Aspect Ratio (PAR) Should be the same between Sequential Sw Sets at the Splice point', violated for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with - PAR ".$par_p1." and ".$par_p2.".\n";
445                }
446            }
447        }   
448    }
449    return $errorMsg;
450}
451function checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
452{
453    $period_count=sizeof($MediaProfDatabase);
454    $adapt_count=sizeof($MediaProfDatabase[0]);
455    $errorMsg="";
456    for($i=0;$i<($period_count-1);$i++)
457    {
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
459        {
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
464                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
465                if($hdlr=="vide")
466                    $framerate_p1=getFrameRate($xml_rep_P1);
467                    
468            }
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
471                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
472                if($hdlr=="vide"){
473                    $framerate_p2=getFrameRate($xml_rep_P2);
474
475            
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
477                    if($remainder !=0)
478                        $errorMsg="###Warning: WAVE Content Spec 2018Ed-Section 7.2.2: 'Frame rate Should be the same family of multiples between Sequential Sw Sets at the Splice point', violated for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with framerates of ".$framerate_p1." and ".$framerate_p2." respectively.\n";
479                    }
480            }
481              
482        }   
483    }
484    return $errorMsg;
485}
486
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
492    {
493        $nal_unit=$xml->getElementsByTagName("NALUnit");
494        if($nal_unit->length==0){
495          $framerate=0;
496        }
497        else{
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
499            {
500                if($nal_unit->item($nal_count)->getAttribute("nal_type")=="0x07")
501                {    $sps_unit=$nal_count;
502                     break;
503                }  
504            }
505
506            $comment=$nal_unit->item($sps_unit)->getElementsByTagName("comment")->item(0);  
507
508
509            if($comment->getAttribute("vui_parameters_present_flag")=="0x1")
510            {
511                if($comment->getAttribute("timing_info_present_flag")=="0x1" )
512                {
513                    $num_units_in_tick=$comment->getAttribute("num_units_in_tick");
514                    $time_scale=$comment->getAttribute("time_scale");
515                    $framerate=$time_scale/(2*$num_units_in_tick);
516                }
517            }
518        }
519    }
520    else if($sdType=='hev1' || $sdType=='hvc1')
521    {
522
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
525            $framerate=0;
526        }
527        else{
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
529            {
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
531                {    $sps_unit=$nal_count;
532                     break;
533                }  
534            }
535
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
538            {
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
540              {
541                  $num_units_in_tick=$sps->getAttribute("vui_num_units_in_tick");
542                  $time_scale=$sps->getAttribute("vui_time_scale");
543                  $framerate=$time_scale/($num_units_in_tick);
544              }
545            }
546        }
547    }
548    return $framerate;
549}
550function checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
551{
552    $period_count=sizeof($MediaProfDatabase);
553    $adapt_count=sizeof($MediaProfDatabase[0]);
554    $errorMsg="";
555    for($i=0;$i<($period_count-1);$i++)
556    {
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
558        {
559            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
560            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
561            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
562            if($xml_rep_P1){
563                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
564                if($hdlr=="soun"){
565                    $decoderSpecInfo=$xml_rep_P1->getElementsByTagName("DecoderSpecificInfo")->item(0);
566                    $channels_p1=$decoderSpecInfo->getAttribute("channelConfig");
567                }
568            }
569            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
570            if($xml_rep_P2){
571                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
572                if($hdlr=="soun"){
573                    $decoderSpecInfo=$xml_rep_P2->getElementsByTagName("DecoderSpecificInfo")->item(0);
574                    $channels_p2=$decoderSpecInfo->getAttribute("channelConfig");
575
576                    if($channels_p1 !=$channels_p2)
577                        $errorMsg="###Warning: WAVE Content Spec 2018Ed-Section 7.2.2: 'Audio channel configuration Should allow the same stereo or multichannel config between Sequential Sw Sets at the Splice point', violated for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with channels ".$channels_p1." and ".$channels_p2." respectively.\n";
578                    }
579            }
580              
581        }   
582    }
583    return $errorMsg;
584}
585?>

Paths

Below are the source code lines that represent each code path as identified by Xdebug. Please note a path is not necessarily coterminous with a line, a line may contain multiple paths and therefore show up more than once. Please also be aware that some paths may include implicit rather than explicit branches, e.g. an if statement always has an else as part of its logical flow even if you didn't write one.

CTABaselineSpliceChecks
9function CTABaselineSpliceChecks()
10{
11    global $MediaProfDatabase, $session_dir, $string_info, $progress_xml, $progress_report, $adaptation_set_template,$reprsentation_template, $CTAspliceConstraitsLog;
12    $opfile="";
13    if(!($opfile = open_file($session_dir . '/' . $CTAspliceConstraitsLog . '.txt', 'w'))){
14        echo "Error opening/creating SpliceConstraints conformance check file: "."./SpliceConstraints_infofile_ctawave.txt";
15        return;
9function CTABaselineSpliceChecks()
10{
11    global $MediaProfDatabase, $session_dir, $string_info, $progress_xml, $progress_report, $adaptation_set_template,$reprsentation_template, $CTAspliceConstraitsLog;
12    $opfile="";
13    if(!($opfile = open_file($session_dir . '/' . $CTAspliceConstraitsLog . '.txt', 'w'))){
17    $error=checkSequentialSwSetMProfile($MediaProfDatabase);
18    fwrite($opfile, $error);
19    $error=checkDiscontinuousSplicePoints($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
20    fwrite($opfile, $error);
21    $error=checkEncryptionChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
22    fwrite($opfile, $error);
23    $error=checkSampleEntryChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
24    fwrite($opfile, $error);
25    $error=checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
26    fwrite($opfile, $error);
27    $error=checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
28    fwrite($opfile, $error);
29    $error=checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
30    fwrite($opfile, $error);
31    $error=checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
32    fwrite($opfile, $error);
33    
34    fclose($opfile);
35    
36    WAVEProgramChecks();
37    
38    $searchfiles = file_get_contents($session_dir.'/'.$CTAspliceConstraitsLog.'.txt');
39    if(strpos($searchfiles, "CTAWAVE check violated") !== FALSE){
40        $progress_xml->Results[0]->addChild('CTAWAVESpliceConstraints', 'error');
41        $file_error[] = $session_dir.'/'.$CTAspliceConstraitsLog.'.html';
51    $progress_xml->asXml(trim($session_dir . '/' . $progress_report));
52    tabulateResults($session_dir.'/'.$CTAspliceConstraitsLog.'.txt', 'Cross');
53    print_console($session_dir.'/'.$CTAspliceConstraitsLog.'.txt', " CTA WAVE Baseline Splice Constraints Results");
54}
9function CTABaselineSpliceChecks()
10{
11    global $MediaProfDatabase, $session_dir, $string_info, $progress_xml, $progress_report, $adaptation_set_template,$reprsentation_template, $CTAspliceConstraitsLog;
12    $opfile="";
13    if(!($opfile = open_file($session_dir . '/' . $CTAspliceConstraitsLog . '.txt', 'w'))){
17    $error=checkSequentialSwSetMProfile($MediaProfDatabase);
18    fwrite($opfile, $error);
19    $error=checkDiscontinuousSplicePoints($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
20    fwrite($opfile, $error);
21    $error=checkEncryptionChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
22    fwrite($opfile, $error);
23    $error=checkSampleEntryChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
24    fwrite($opfile, $error);
25    $error=checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
26    fwrite($opfile, $error);
27    $error=checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
28    fwrite($opfile, $error);
29    $error=checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
30    fwrite($opfile, $error);
31    $error=checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
32    fwrite($opfile, $error);
33    
34    fclose($opfile);
35    
36    WAVEProgramChecks();
37    
38    $searchfiles = file_get_contents($session_dir.'/'.$CTAspliceConstraitsLog.'.txt');
39    if(strpos($searchfiles, "CTAWAVE check violated") !== FALSE){
43    elseif(strpos($searchfiles, "Warning") !== FALSE || strpos($searchfiles, "WARNING") !== FALSE){
43    elseif(strpos($searchfiles, "Warning") !== FALSE || strpos($searchfiles, "WARNING") !== FALSE){
43    elseif(strpos($searchfiles, "Warning") !== FALSE || strpos($searchfiles, "WARNING") !== FALSE){
44        $progress_xml->Results[0]->addChild('CTAWAVESpliceConstraints', 'warning');
45        $file_error[] = $session_dir.'/'.$CTAspliceConstraitsLog.'.html';
51    $progress_xml->asXml(trim($session_dir . '/' . $progress_report));
52    tabulateResults($session_dir.'/'.$CTAspliceConstraitsLog.'.txt', 'Cross');
53    print_console($session_dir.'/'.$CTAspliceConstraitsLog.'.txt', " CTA WAVE Baseline Splice Constraints Results");
54}
9function CTABaselineSpliceChecks()
10{
11    global $MediaProfDatabase, $session_dir, $string_info, $progress_xml, $progress_report, $adaptation_set_template,$reprsentation_template, $CTAspliceConstraitsLog;
12    $opfile="";
13    if(!($opfile = open_file($session_dir . '/' . $CTAspliceConstraitsLog . '.txt', 'w'))){
17    $error=checkSequentialSwSetMProfile($MediaProfDatabase);
18    fwrite($opfile, $error);
19    $error=checkDiscontinuousSplicePoints($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
20    fwrite($opfile, $error);
21    $error=checkEncryptionChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
22    fwrite($opfile, $error);
23    $error=checkSampleEntryChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
24    fwrite($opfile, $error);
25    $error=checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
26    fwrite($opfile, $error);
27    $error=checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
28    fwrite($opfile, $error);
29    $error=checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
30    fwrite($opfile, $error);
31    $error=checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
32    fwrite($opfile, $error);
33    
34    fclose($opfile);
35    
36    WAVEProgramChecks();
37    
38    $searchfiles = file_get_contents($session_dir.'/'.$CTAspliceConstraitsLog.'.txt');
39    if(strpos($searchfiles, "CTAWAVE check violated") !== FALSE){
43    elseif(strpos($searchfiles, "Warning") !== FALSE || strpos($searchfiles, "WARNING") !== FALSE){
43    elseif(strpos($searchfiles, "Warning") !== FALSE || strpos($searchfiles, "WARNING") !== FALSE){
43    elseif(strpos($searchfiles, "Warning") !== FALSE || strpos($searchfiles, "WARNING") !== FALSE){
48        $progress_xml->Results[0]->addChild('CTAWAVESpliceConstraints', 'noerror');
49        $file_error[] = "noerror";
50    }
51    $progress_xml->asXml(trim($session_dir . '/' . $progress_report));
51    $progress_xml->asXml(trim($session_dir . '/' . $progress_report));
52    tabulateResults($session_dir.'/'.$CTAspliceConstraitsLog.'.txt', 'Cross');
53    print_console($session_dir.'/'.$CTAspliceConstraitsLog.'.txt', " CTA WAVE Baseline Splice Constraints Results");
54}
9function CTABaselineSpliceChecks()
10{
11    global $MediaProfDatabase, $session_dir, $string_info, $progress_xml, $progress_report, $adaptation_set_template,$reprsentation_template, $CTAspliceConstraitsLog;
12    $opfile="";
13    if(!($opfile = open_file($session_dir . '/' . $CTAspliceConstraitsLog . '.txt', 'w'))){
17    $error=checkSequentialSwSetMProfile($MediaProfDatabase);
18    fwrite($opfile, $error);
19    $error=checkDiscontinuousSplicePoints($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
20    fwrite($opfile, $error);
21    $error=checkEncryptionChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
22    fwrite($opfile, $error);
23    $error=checkSampleEntryChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
24    fwrite($opfile, $error);
25    $error=checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
26    fwrite($opfile, $error);
27    $error=checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
28    fwrite($opfile, $error);
29    $error=checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
30    fwrite($opfile, $error);
31    $error=checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
32    fwrite($opfile, $error);
33    
34    fclose($opfile);
35    
36    WAVEProgramChecks();
37    
38    $searchfiles = file_get_contents($session_dir.'/'.$CTAspliceConstraitsLog.'.txt');
39    if(strpos($searchfiles, "CTAWAVE check violated") !== FALSE){
43    elseif(strpos($searchfiles, "Warning") !== FALSE || strpos($searchfiles, "WARNING") !== FALSE){
43    elseif(strpos($searchfiles, "Warning") !== FALSE || strpos($searchfiles, "WARNING") !== FALSE){
44        $progress_xml->Results[0]->addChild('CTAWAVESpliceConstraints', 'warning');
45        $file_error[] = $session_dir.'/'.$CTAspliceConstraitsLog.'.html';
51    $progress_xml->asXml(trim($session_dir . '/' . $progress_report));
52    tabulateResults($session_dir.'/'.$CTAspliceConstraitsLog.'.txt', 'Cross');
53    print_console($session_dir.'/'.$CTAspliceConstraitsLog.'.txt', " CTA WAVE Baseline Splice Constraints Results");
54}
9function CTABaselineSpliceChecks()
10{
11    global $MediaProfDatabase, $session_dir, $string_info, $progress_xml, $progress_report, $adaptation_set_template,$reprsentation_template, $CTAspliceConstraitsLog;
12    $opfile="";
13    if(!($opfile = open_file($session_dir . '/' . $CTAspliceConstraitsLog . '.txt', 'w'))){
17    $error=checkSequentialSwSetMProfile($MediaProfDatabase);
18    fwrite($opfile, $error);
19    $error=checkDiscontinuousSplicePoints($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
20    fwrite($opfile, $error);
21    $error=checkEncryptionChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
22    fwrite($opfile, $error);
23    $error=checkSampleEntryChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
24    fwrite($opfile, $error);
25    $error=checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
26    fwrite($opfile, $error);
27    $error=checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
28    fwrite($opfile, $error);
29    $error=checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
30    fwrite($opfile, $error);
31    $error=checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template);
32    fwrite($opfile, $error);
33    
34    fclose($opfile);
35    
36    WAVEProgramChecks();
37    
38    $searchfiles = file_get_contents($session_dir.'/'.$CTAspliceConstraitsLog.'.txt');
39    if(strpos($searchfiles, "CTAWAVE check violated") !== FALSE){
43    elseif(strpos($searchfiles, "Warning") !== FALSE || strpos($searchfiles, "WARNING") !== FALSE){
43    elseif(strpos($searchfiles, "Warning") !== FALSE || strpos($searchfiles, "WARNING") !== FALSE){
48        $progress_xml->Results[0]->addChild('CTAWAVESpliceConstraints', 'noerror');
49        $file_error[] = "noerror";
50    }
51    $progress_xml->asXml(trim($session_dir . '/' . $progress_report));
51    $progress_xml->asXml(trim($session_dir . '/' . $progress_report));
52    tabulateResults($session_dir.'/'.$CTAspliceConstraitsLog.'.txt', 'Cross');
53    print_console($session_dir.'/'.$CTAspliceConstraitsLog.'.txt', " CTA WAVE Baseline Splice Constraints Results");
54}
checkAudioChannelSplicePoint
550function checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
551{
552    $period_count=sizeof($MediaProfDatabase);
553    $adapt_count=sizeof($MediaProfDatabase[0]);
554    $errorMsg="";
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
583    return $errorMsg;
584}
550function checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
551{
552    $period_count=sizeof($MediaProfDatabase);
553    $adapt_count=sizeof($MediaProfDatabase[0]);
554    $errorMsg="";
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
583    return $errorMsg;
584}
550function checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
551{
552    $period_count=sizeof($MediaProfDatabase);
553    $adapt_count=sizeof($MediaProfDatabase[0]);
554    $errorMsg="";
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
559            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
560            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
561            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
562            if($xml_rep_P1){
563                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
564                if($hdlr=="soun"){
565                    $decoderSpecInfo=$xml_rep_P1->getElementsByTagName("DecoderSpecificInfo")->item(0);
566                    $channels_p1=$decoderSpecInfo->getAttribute("channelConfig");
567                }
568            }
569            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
569            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
570            if($xml_rep_P2){
571                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
572                if($hdlr=="soun"){
573                    $decoderSpecInfo=$xml_rep_P2->getElementsByTagName("DecoderSpecificInfo")->item(0);
574                    $channels_p2=$decoderSpecInfo->getAttribute("channelConfig");
575
576                    if($channels_p1 !=$channels_p2)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
558        {
559            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
560            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
561            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
562            if($xml_rep_P1){
563                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
564                if($hdlr=="soun"){
565                    $decoderSpecInfo=$xml_rep_P1->getElementsByTagName("DecoderSpecificInfo")->item(0);
566                    $channels_p1=$decoderSpecInfo->getAttribute("channelConfig");
567                }
568            }
569            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
570            if($xml_rep_P2){
571                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
572                if($hdlr=="soun"){
573                    $decoderSpecInfo=$xml_rep_P2->getElementsByTagName("DecoderSpecificInfo")->item(0);
574                    $channels_p2=$decoderSpecInfo->getAttribute("channelConfig");
575
576                    if($channels_p1 !=$channels_p2)
577                        $errorMsg="###Warning: WAVE Content Spec 2018Ed-Section 7.2.2: 'Audio channel configuration Should allow the same stereo or multichannel config between Sequential Sw Sets at the Splice point', violated for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with channels ".$channels_p1." and ".$channels_p2." respectively.\n";
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
583    return $errorMsg;
584}
550function checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
551{
552    $period_count=sizeof($MediaProfDatabase);
553    $adapt_count=sizeof($MediaProfDatabase[0]);
554    $errorMsg="";
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
559            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
560            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
561            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
562            if($xml_rep_P1){
563                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
564                if($hdlr=="soun"){
565                    $decoderSpecInfo=$xml_rep_P1->getElementsByTagName("DecoderSpecificInfo")->item(0);
566                    $channels_p1=$decoderSpecInfo->getAttribute("channelConfig");
567                }
568            }
569            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
569            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
570            if($xml_rep_P2){
571                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
572                if($hdlr=="soun"){
573                    $decoderSpecInfo=$xml_rep_P2->getElementsByTagName("DecoderSpecificInfo")->item(0);
574                    $channels_p2=$decoderSpecInfo->getAttribute("channelConfig");
575
576                    if($channels_p1 !=$channels_p2)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
583    return $errorMsg;
584}
550function checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
551{
552    $period_count=sizeof($MediaProfDatabase);
553    $adapt_count=sizeof($MediaProfDatabase[0]);
554    $errorMsg="";
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
559            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
560            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
561            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
562            if($xml_rep_P1){
563                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
564                if($hdlr=="soun"){
565                    $decoderSpecInfo=$xml_rep_P1->getElementsByTagName("DecoderSpecificInfo")->item(0);
566                    $channels_p1=$decoderSpecInfo->getAttribute("channelConfig");
567                }
568            }
569            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
569            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
570            if($xml_rep_P2){
571                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
572                if($hdlr=="soun"){
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
583    return $errorMsg;
584}
550function checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
551{
552    $period_count=sizeof($MediaProfDatabase);
553    $adapt_count=sizeof($MediaProfDatabase[0]);
554    $errorMsg="";
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
559            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
560            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
561            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
562            if($xml_rep_P1){
563                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
564                if($hdlr=="soun"){
565                    $decoderSpecInfo=$xml_rep_P1->getElementsByTagName("DecoderSpecificInfo")->item(0);
566                    $channels_p1=$decoderSpecInfo->getAttribute("channelConfig");
567                }
568            }
569            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
569            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
570            if($xml_rep_P2){
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
583    return $errorMsg;
584}
550function checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
551{
552    $period_count=sizeof($MediaProfDatabase);
553    $adapt_count=sizeof($MediaProfDatabase[0]);
554    $errorMsg="";
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
559            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
560            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
561            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
562            if($xml_rep_P1){
563                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
564                if($hdlr=="soun"){
569            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
570            if($xml_rep_P2){
571                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
572                if($hdlr=="soun"){
573                    $decoderSpecInfo=$xml_rep_P2->getElementsByTagName("DecoderSpecificInfo")->item(0);
574                    $channels_p2=$decoderSpecInfo->getAttribute("channelConfig");
575
576                    if($channels_p1 !=$channels_p2)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
558        {
559            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
560            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
561            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
562            if($xml_rep_P1){
563                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
564                if($hdlr=="soun"){
565                    $decoderSpecInfo=$xml_rep_P1->getElementsByTagName("DecoderSpecificInfo")->item(0);
566                    $channels_p1=$decoderSpecInfo->getAttribute("channelConfig");
567                }
568            }
569            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
570            if($xml_rep_P2){
571                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
572                if($hdlr=="soun"){
573                    $decoderSpecInfo=$xml_rep_P2->getElementsByTagName("DecoderSpecificInfo")->item(0);
574                    $channels_p2=$decoderSpecInfo->getAttribute("channelConfig");
575
576                    if($channels_p1 !=$channels_p2)
577                        $errorMsg="###Warning: WAVE Content Spec 2018Ed-Section 7.2.2: 'Audio channel configuration Should allow the same stereo or multichannel config between Sequential Sw Sets at the Splice point', violated for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with channels ".$channels_p1." and ".$channels_p2." respectively.\n";
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
583    return $errorMsg;
584}
550function checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
551{
552    $period_count=sizeof($MediaProfDatabase);
553    $adapt_count=sizeof($MediaProfDatabase[0]);
554    $errorMsg="";
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
559            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
560            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
561            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
562            if($xml_rep_P1){
563                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
564                if($hdlr=="soun"){
569            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
570            if($xml_rep_P2){
571                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
572                if($hdlr=="soun"){
573                    $decoderSpecInfo=$xml_rep_P2->getElementsByTagName("DecoderSpecificInfo")->item(0);
574                    $channels_p2=$decoderSpecInfo->getAttribute("channelConfig");
575
576                    if($channels_p1 !=$channels_p2)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
583    return $errorMsg;
584}
550function checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
551{
552    $period_count=sizeof($MediaProfDatabase);
553    $adapt_count=sizeof($MediaProfDatabase[0]);
554    $errorMsg="";
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
559            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
560            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
561            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
562            if($xml_rep_P1){
563                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
564                if($hdlr=="soun"){
569            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
570            if($xml_rep_P2){
571                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
572                if($hdlr=="soun"){
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
583    return $errorMsg;
584}
550function checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
551{
552    $period_count=sizeof($MediaProfDatabase);
553    $adapt_count=sizeof($MediaProfDatabase[0]);
554    $errorMsg="";
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
559            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
560            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
561            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
562            if($xml_rep_P1){
563                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
564                if($hdlr=="soun"){
569            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
570            if($xml_rep_P2){
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
583    return $errorMsg;
584}
550function checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
551{
552    $period_count=sizeof($MediaProfDatabase);
553    $adapt_count=sizeof($MediaProfDatabase[0]);
554    $errorMsg="";
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
559            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
560            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
561            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
562            if($xml_rep_P1){
569            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
570            if($xml_rep_P2){
571                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
572                if($hdlr=="soun"){
573                    $decoderSpecInfo=$xml_rep_P2->getElementsByTagName("DecoderSpecificInfo")->item(0);
574                    $channels_p2=$decoderSpecInfo->getAttribute("channelConfig");
575
576                    if($channels_p1 !=$channels_p2)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
558        {
559            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
560            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
561            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
562            if($xml_rep_P1){
563                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
564                if($hdlr=="soun"){
565                    $decoderSpecInfo=$xml_rep_P1->getElementsByTagName("DecoderSpecificInfo")->item(0);
566                    $channels_p1=$decoderSpecInfo->getAttribute("channelConfig");
567                }
568            }
569            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
570            if($xml_rep_P2){
571                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
572                if($hdlr=="soun"){
573                    $decoderSpecInfo=$xml_rep_P2->getElementsByTagName("DecoderSpecificInfo")->item(0);
574                    $channels_p2=$decoderSpecInfo->getAttribute("channelConfig");
575
576                    if($channels_p1 !=$channels_p2)
577                        $errorMsg="###Warning: WAVE Content Spec 2018Ed-Section 7.2.2: 'Audio channel configuration Should allow the same stereo or multichannel config between Sequential Sw Sets at the Splice point', violated for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with channels ".$channels_p1." and ".$channels_p2." respectively.\n";
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
583    return $errorMsg;
584}
550function checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
551{
552    $period_count=sizeof($MediaProfDatabase);
553    $adapt_count=sizeof($MediaProfDatabase[0]);
554    $errorMsg="";
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
559            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
560            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
561            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
562            if($xml_rep_P1){
569            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
570            if($xml_rep_P2){
571                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
572                if($hdlr=="soun"){
573                    $decoderSpecInfo=$xml_rep_P2->getElementsByTagName("DecoderSpecificInfo")->item(0);
574                    $channels_p2=$decoderSpecInfo->getAttribute("channelConfig");
575
576                    if($channels_p1 !=$channels_p2)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
583    return $errorMsg;
584}
550function checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
551{
552    $period_count=sizeof($MediaProfDatabase);
553    $adapt_count=sizeof($MediaProfDatabase[0]);
554    $errorMsg="";
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
559            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
560            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
561            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
562            if($xml_rep_P1){
569            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
570            if($xml_rep_P2){
571                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
572                if($hdlr=="soun"){
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
583    return $errorMsg;
584}
550function checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
551{
552    $period_count=sizeof($MediaProfDatabase);
553    $adapt_count=sizeof($MediaProfDatabase[0]);
554    $errorMsg="";
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
559            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
560            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
561            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
562            if($xml_rep_P1){
569            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
570            if($xml_rep_P2){
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
557       for($adapt=0;$adapt<$adapt_count;$adapt++)
555    for($i=0;$i<($period_count-1);$i++)
555    for($i=0;$i<($period_count-1);$i++)
583    return $errorMsg;
584}
checkDefaultKIDChangeSplicePoint
255function checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
256{
257    $errorMsg="";
258    $period_count=sizeof($MediaProfDatabase);
259    $adapt_count=sizeof($MediaProfDatabase[0]);
260    $defaultKID_p1=0;$defaultKID_p2=0;
261    $errorMsg="";
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
288    return $errorMsg;
289}
255function checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
256{
257    $errorMsg="";
258    $period_count=sizeof($MediaProfDatabase);
259    $adapt_count=sizeof($MediaProfDatabase[0]);
260    $defaultKID_p1=0;$defaultKID_p2=0;
261    $errorMsg="";
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
288    return $errorMsg;
289}
255function checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
256{
257    $errorMsg="";
258    $period_count=sizeof($MediaProfDatabase);
259    $adapt_count=sizeof($MediaProfDatabase[0]);
260    $defaultKID_p1=0;$defaultKID_p2=0;
261    $errorMsg="";
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
270                $tenc=$xml_rep_P1->getElementsByTagName("tenc");
271                if($tenc->length>0)
272                  $defaultKID_p1=$tenc->item(0)->getAttribute("default_KID");
273               
274            }
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
277                $tenc=$xml_rep_P2->getElementsByTagName("tenc");
278                if($tenc->length>0)
279                  $defaultKID_p2=$tenc->item(0)->getAttribute("default_KID");
280
281            }
282            if($defaultKID_p1!=$defaultKID_p2 )
282            if($defaultKID_p1!=$defaultKID_p2 )
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
265        {
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
270                $tenc=$xml_rep_P1->getElementsByTagName("tenc");
271                if($tenc->length>0)
272                  $defaultKID_p1=$tenc->item(0)->getAttribute("default_KID");
273               
274            }
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
277                $tenc=$xml_rep_P2->getElementsByTagName("tenc");
278                if($tenc->length>0)
279                  $defaultKID_p2=$tenc->item(0)->getAttribute("default_KID");
280
281            }
282            if($defaultKID_p1!=$defaultKID_p2 )
283                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Default KID can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with values -".$defaultKID_p1." and ".$defaultKID_p2." respectively.\n";
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
288    return $errorMsg;
289}
255function checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
256{
257    $errorMsg="";
258    $period_count=sizeof($MediaProfDatabase);
259    $adapt_count=sizeof($MediaProfDatabase[0]);
260    $defaultKID_p1=0;$defaultKID_p2=0;
261    $errorMsg="";
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
270                $tenc=$xml_rep_P1->getElementsByTagName("tenc");
271                if($tenc->length>0)
272                  $defaultKID_p1=$tenc->item(0)->getAttribute("default_KID");
273               
274            }
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
277                $tenc=$xml_rep_P2->getElementsByTagName("tenc");
278                if($tenc->length>0)
279                  $defaultKID_p2=$tenc->item(0)->getAttribute("default_KID");
280
281            }
282            if($defaultKID_p1!=$defaultKID_p2 )
282            if($defaultKID_p1!=$defaultKID_p2 )
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
288    return $errorMsg;
289}
255function checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
256{
257    $errorMsg="";
258    $period_count=sizeof($MediaProfDatabase);
259    $adapt_count=sizeof($MediaProfDatabase[0]);
260    $defaultKID_p1=0;$defaultKID_p2=0;
261    $errorMsg="";
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
270                $tenc=$xml_rep_P1->getElementsByTagName("tenc");
271                if($tenc->length>0)
272                  $defaultKID_p1=$tenc->item(0)->getAttribute("default_KID");
273               
274            }
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
277                $tenc=$xml_rep_P2->getElementsByTagName("tenc");
278                if($tenc->length>0)
282            if($defaultKID_p1!=$defaultKID_p2 )
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
265        {
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
270                $tenc=$xml_rep_P1->getElementsByTagName("tenc");
271                if($tenc->length>0)
272                  $defaultKID_p1=$tenc->item(0)->getAttribute("default_KID");
273               
274            }
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
277                $tenc=$xml_rep_P2->getElementsByTagName("tenc");
278                if($tenc->length>0)
279                  $defaultKID_p2=$tenc->item(0)->getAttribute("default_KID");
280
281            }
282            if($defaultKID_p1!=$defaultKID_p2 )
283                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Default KID can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with values -".$defaultKID_p1." and ".$defaultKID_p2." respectively.\n";
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
288    return $errorMsg;
289}
255function checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
256{
257    $errorMsg="";
258    $period_count=sizeof($MediaProfDatabase);
259    $adapt_count=sizeof($MediaProfDatabase[0]);
260    $defaultKID_p1=0;$defaultKID_p2=0;
261    $errorMsg="";
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
270                $tenc=$xml_rep_P1->getElementsByTagName("tenc");
271                if($tenc->length>0)
272                  $defaultKID_p1=$tenc->item(0)->getAttribute("default_KID");
273               
274            }
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
277                $tenc=$xml_rep_P2->getElementsByTagName("tenc");
278                if($tenc->length>0)
282            if($defaultKID_p1!=$defaultKID_p2 )
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
288    return $errorMsg;
289}
255function checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
256{
257    $errorMsg="";
258    $period_count=sizeof($MediaProfDatabase);
259    $adapt_count=sizeof($MediaProfDatabase[0]);
260    $defaultKID_p1=0;$defaultKID_p2=0;
261    $errorMsg="";
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
270                $tenc=$xml_rep_P1->getElementsByTagName("tenc");
271                if($tenc->length>0)
272                  $defaultKID_p1=$tenc->item(0)->getAttribute("default_KID");
273               
274            }
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
282            if($defaultKID_p1!=$defaultKID_p2 )
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
265        {
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
270                $tenc=$xml_rep_P1->getElementsByTagName("tenc");
271                if($tenc->length>0)
272                  $defaultKID_p1=$tenc->item(0)->getAttribute("default_KID");
273               
274            }
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
277                $tenc=$xml_rep_P2->getElementsByTagName("tenc");
278                if($tenc->length>0)
279                  $defaultKID_p2=$tenc->item(0)->getAttribute("default_KID");
280
281            }
282            if($defaultKID_p1!=$defaultKID_p2 )
283                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Default KID can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with values -".$defaultKID_p1." and ".$defaultKID_p2." respectively.\n";
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
288    return $errorMsg;
289}
255function checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
256{
257    $errorMsg="";
258    $period_count=sizeof($MediaProfDatabase);
259    $adapt_count=sizeof($MediaProfDatabase[0]);
260    $defaultKID_p1=0;$defaultKID_p2=0;
261    $errorMsg="";
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
270                $tenc=$xml_rep_P1->getElementsByTagName("tenc");
271                if($tenc->length>0)
272                  $defaultKID_p1=$tenc->item(0)->getAttribute("default_KID");
273               
274            }
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
282            if($defaultKID_p1!=$defaultKID_p2 )
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
288    return $errorMsg;
289}
255function checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
256{
257    $errorMsg="";
258    $period_count=sizeof($MediaProfDatabase);
259    $adapt_count=sizeof($MediaProfDatabase[0]);
260    $defaultKID_p1=0;$defaultKID_p2=0;
261    $errorMsg="";
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
270                $tenc=$xml_rep_P1->getElementsByTagName("tenc");
271                if($tenc->length>0)
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
277                $tenc=$xml_rep_P2->getElementsByTagName("tenc");
278                if($tenc->length>0)
279                  $defaultKID_p2=$tenc->item(0)->getAttribute("default_KID");
280
281            }
282            if($defaultKID_p1!=$defaultKID_p2 )
282            if($defaultKID_p1!=$defaultKID_p2 )
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
265        {
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
270                $tenc=$xml_rep_P1->getElementsByTagName("tenc");
271                if($tenc->length>0)
272                  $defaultKID_p1=$tenc->item(0)->getAttribute("default_KID");
273               
274            }
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
277                $tenc=$xml_rep_P2->getElementsByTagName("tenc");
278                if($tenc->length>0)
279                  $defaultKID_p2=$tenc->item(0)->getAttribute("default_KID");
280
281            }
282            if($defaultKID_p1!=$defaultKID_p2 )
283                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Default KID can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with values -".$defaultKID_p1." and ".$defaultKID_p2." respectively.\n";
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
288    return $errorMsg;
289}
255function checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
256{
257    $errorMsg="";
258    $period_count=sizeof($MediaProfDatabase);
259    $adapt_count=sizeof($MediaProfDatabase[0]);
260    $defaultKID_p1=0;$defaultKID_p2=0;
261    $errorMsg="";
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
270                $tenc=$xml_rep_P1->getElementsByTagName("tenc");
271                if($tenc->length>0)
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
277                $tenc=$xml_rep_P2->getElementsByTagName("tenc");
278                if($tenc->length>0)
279                  $defaultKID_p2=$tenc->item(0)->getAttribute("default_KID");
280
281            }
282            if($defaultKID_p1!=$defaultKID_p2 )
282            if($defaultKID_p1!=$defaultKID_p2 )
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
288    return $errorMsg;
289}
255function checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
256{
257    $errorMsg="";
258    $period_count=sizeof($MediaProfDatabase);
259    $adapt_count=sizeof($MediaProfDatabase[0]);
260    $defaultKID_p1=0;$defaultKID_p2=0;
261    $errorMsg="";
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
270                $tenc=$xml_rep_P1->getElementsByTagName("tenc");
271                if($tenc->length>0)
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
277                $tenc=$xml_rep_P2->getElementsByTagName("tenc");
278                if($tenc->length>0)
282            if($defaultKID_p1!=$defaultKID_p2 )
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
265        {
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
270                $tenc=$xml_rep_P1->getElementsByTagName("tenc");
271                if($tenc->length>0)
272                  $defaultKID_p1=$tenc->item(0)->getAttribute("default_KID");
273               
274            }
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
277                $tenc=$xml_rep_P2->getElementsByTagName("tenc");
278                if($tenc->length>0)
279                  $defaultKID_p2=$tenc->item(0)->getAttribute("default_KID");
280
281            }
282            if($defaultKID_p1!=$defaultKID_p2 )
283                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Default KID can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with values -".$defaultKID_p1." and ".$defaultKID_p2." respectively.\n";
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
288    return $errorMsg;
289}
255function checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
256{
257    $errorMsg="";
258    $period_count=sizeof($MediaProfDatabase);
259    $adapt_count=sizeof($MediaProfDatabase[0]);
260    $defaultKID_p1=0;$defaultKID_p2=0;
261    $errorMsg="";
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
270                $tenc=$xml_rep_P1->getElementsByTagName("tenc");
271                if($tenc->length>0)
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
277                $tenc=$xml_rep_P2->getElementsByTagName("tenc");
278                if($tenc->length>0)
282            if($defaultKID_p1!=$defaultKID_p2 )
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
288    return $errorMsg;
289}
255function checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
256{
257    $errorMsg="";
258    $period_count=sizeof($MediaProfDatabase);
259    $adapt_count=sizeof($MediaProfDatabase[0]);
260    $defaultKID_p1=0;$defaultKID_p2=0;
261    $errorMsg="";
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
270                $tenc=$xml_rep_P1->getElementsByTagName("tenc");
271                if($tenc->length>0)
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
282            if($defaultKID_p1!=$defaultKID_p2 )
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
265        {
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
270                $tenc=$xml_rep_P1->getElementsByTagName("tenc");
271                if($tenc->length>0)
272                  $defaultKID_p1=$tenc->item(0)->getAttribute("default_KID");
273               
274            }
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
277                $tenc=$xml_rep_P2->getElementsByTagName("tenc");
278                if($tenc->length>0)
279                  $defaultKID_p2=$tenc->item(0)->getAttribute("default_KID");
280
281            }
282            if($defaultKID_p1!=$defaultKID_p2 )
283                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Default KID can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with values -".$defaultKID_p1." and ".$defaultKID_p2." respectively.\n";
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
288    return $errorMsg;
289}
255function checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
256{
257    $errorMsg="";
258    $period_count=sizeof($MediaProfDatabase);
259    $adapt_count=sizeof($MediaProfDatabase[0]);
260    $defaultKID_p1=0;$defaultKID_p2=0;
261    $errorMsg="";
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
270                $tenc=$xml_rep_P1->getElementsByTagName("tenc");
271                if($tenc->length>0)
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
282            if($defaultKID_p1!=$defaultKID_p2 )
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
288    return $errorMsg;
289}
255function checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
256{
257    $errorMsg="";
258    $period_count=sizeof($MediaProfDatabase);
259    $adapt_count=sizeof($MediaProfDatabase[0]);
260    $defaultKID_p1=0;$defaultKID_p2=0;
261    $errorMsg="";
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
277                $tenc=$xml_rep_P2->getElementsByTagName("tenc");
278                if($tenc->length>0)
279                  $defaultKID_p2=$tenc->item(0)->getAttribute("default_KID");
280
281            }
282            if($defaultKID_p1!=$defaultKID_p2 )
282            if($defaultKID_p1!=$defaultKID_p2 )
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
265        {
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
270                $tenc=$xml_rep_P1->getElementsByTagName("tenc");
271                if($tenc->length>0)
272                  $defaultKID_p1=$tenc->item(0)->getAttribute("default_KID");
273               
274            }
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
277                $tenc=$xml_rep_P2->getElementsByTagName("tenc");
278                if($tenc->length>0)
279                  $defaultKID_p2=$tenc->item(0)->getAttribute("default_KID");
280
281            }
282            if($defaultKID_p1!=$defaultKID_p2 )
283                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Default KID can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with values -".$defaultKID_p1." and ".$defaultKID_p2." respectively.\n";
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
288    return $errorMsg;
289}
255function checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
256{
257    $errorMsg="";
258    $period_count=sizeof($MediaProfDatabase);
259    $adapt_count=sizeof($MediaProfDatabase[0]);
260    $defaultKID_p1=0;$defaultKID_p2=0;
261    $errorMsg="";
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
277                $tenc=$xml_rep_P2->getElementsByTagName("tenc");
278                if($tenc->length>0)
279                  $defaultKID_p2=$tenc->item(0)->getAttribute("default_KID");
280
281            }
282            if($defaultKID_p1!=$defaultKID_p2 )
282            if($defaultKID_p1!=$defaultKID_p2 )
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
288    return $errorMsg;
289}
255function checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
256{
257    $errorMsg="";
258    $period_count=sizeof($MediaProfDatabase);
259    $adapt_count=sizeof($MediaProfDatabase[0]);
260    $defaultKID_p1=0;$defaultKID_p2=0;
261    $errorMsg="";
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
277                $tenc=$xml_rep_P2->getElementsByTagName("tenc");
278                if($tenc->length>0)
282            if($defaultKID_p1!=$defaultKID_p2 )
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
265        {
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
270                $tenc=$xml_rep_P1->getElementsByTagName("tenc");
271                if($tenc->length>0)
272                  $defaultKID_p1=$tenc->item(0)->getAttribute("default_KID");
273               
274            }
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
277                $tenc=$xml_rep_P2->getElementsByTagName("tenc");
278                if($tenc->length>0)
279                  $defaultKID_p2=$tenc->item(0)->getAttribute("default_KID");
280
281            }
282            if($defaultKID_p1!=$defaultKID_p2 )
283                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Default KID can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with values -".$defaultKID_p1." and ".$defaultKID_p2." respectively.\n";
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
288    return $errorMsg;
289}
255function checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
256{
257    $errorMsg="";
258    $period_count=sizeof($MediaProfDatabase);
259    $adapt_count=sizeof($MediaProfDatabase[0]);
260    $defaultKID_p1=0;$defaultKID_p2=0;
261    $errorMsg="";
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
277                $tenc=$xml_rep_P2->getElementsByTagName("tenc");
278                if($tenc->length>0)
282            if($defaultKID_p1!=$defaultKID_p2 )
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
288    return $errorMsg;
289}
255function checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
256{
257    $errorMsg="";
258    $period_count=sizeof($MediaProfDatabase);
259    $adapt_count=sizeof($MediaProfDatabase[0]);
260    $defaultKID_p1=0;$defaultKID_p2=0;
261    $errorMsg="";
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
282            if($defaultKID_p1!=$defaultKID_p2 )
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
265        {
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
270                $tenc=$xml_rep_P1->getElementsByTagName("tenc");
271                if($tenc->length>0)
272                  $defaultKID_p1=$tenc->item(0)->getAttribute("default_KID");
273               
274            }
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
277                $tenc=$xml_rep_P2->getElementsByTagName("tenc");
278                if($tenc->length>0)
279                  $defaultKID_p2=$tenc->item(0)->getAttribute("default_KID");
280
281            }
282            if($defaultKID_p1!=$defaultKID_p2 )
283                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Default KID can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with values -".$defaultKID_p1." and ".$defaultKID_p2." respectively.\n";
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
288    return $errorMsg;
289}
255function checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
256{
257    $errorMsg="";
258    $period_count=sizeof($MediaProfDatabase);
259    $adapt_count=sizeof($MediaProfDatabase[0]);
260    $defaultKID_p1=0;$defaultKID_p2=0;
261    $errorMsg="";
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
266            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
267            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
268            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
269            if($xml_rep_P1){
275           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
276            if($xml_rep_P2){
282            if($defaultKID_p1!=$defaultKID_p2 )
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
264       for($adapt=0;$adapt<$adapt_count;$adapt++)
262    for($i=0;$i<($period_count-1);$i++)
262    for($i=0;$i<($period_count-1);$i++)
288    return $errorMsg;
289}
checkDiscontinuousSplicePoints
95function checkDiscontinuousSplicePoints($session_dir, $MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
96{
97    $errorMsg="";
98    $period_count=sizeof($MediaProfDatabase);
99    $adapt_count=sizeof($MediaProfDatabase[0]);
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
138    return $errorMsg;
139}
95function checkDiscontinuousSplicePoints($session_dir, $MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
96{
97    $errorMsg="";
98    $period_count=sizeof($MediaProfDatabase);
99    $adapt_count=sizeof($MediaProfDatabase[0]);
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
138    return $errorMsg;
139}
95function checkDiscontinuousSplicePoints($session_dir, $MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
96{
97    $errorMsg="";
98    $period_count=sizeof($MediaProfDatabase);
99    $adapt_count=sizeof($MediaProfDatabase[0]);
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
104            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
105            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
106            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
107            if($xml_rep_P1){
108                $moof_len=$xml_rep_P1->getElementsByTagName("moof")->length;
109                if($moof_len>0)
111                    $tfdt=$xml_rep_P1->getElementsByTagName("tfdt")->item($moof_len-1);
112                    $baseMediaDecodeTime_p1=$tfdt->getAttribute("baseMediaDecodeTime");
113                    $trun=$xml_rep_P1->getElementsByTagName("trun")->item($moof_len-1);
114                    $cummulatedSampleDuration_p1=$trun->getAttribute("cummulatedSampleDuration");
115                    $mdhd=$xml_rep_P1->getElementsByTagName("mdhd")->item(0);
116                    $timescale_1=$mdhd->getAttribute("timescale");
117                }
118            }
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
120            if($xml_rep_P2){
121                $moof_len=$xml_rep_P2->getElementsByTagName("moof")->length;
122                if($moof_len>0)
124                    $tfdt=$xml_rep_P2->getElementsByTagName("tfdt")->item(0);
125                    $baseMediaDecodeTime_p2=$tfdt->getAttribute("baseMediaDecodeTime");
126                    $mdhd=$xml_rep_P2->getElementsByTagName("mdhd")->item(0);
127                    $timescale_2=$mdhd->getAttribute("timescale");
128                    
129                }
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
103        {
104            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
105            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
106            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
107            if($xml_rep_P1){
108                $moof_len=$xml_rep_P1->getElementsByTagName("moof")->length;
109                if($moof_len>0)
110                {
111                    $tfdt=$xml_rep_P1->getElementsByTagName("tfdt")->item($moof_len-1);
112                    $baseMediaDecodeTime_p1=$tfdt->getAttribute("baseMediaDecodeTime");
113                    $trun=$xml_rep_P1->getElementsByTagName("trun")->item($moof_len-1);
114                    $cummulatedSampleDuration_p1=$trun->getAttribute("cummulatedSampleDuration");
115                    $mdhd=$xml_rep_P1->getElementsByTagName("mdhd")->item(0);
116                    $timescale_1=$mdhd->getAttribute("timescale");
117                }
118            }
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
120            if($xml_rep_P2){
121                $moof_len=$xml_rep_P2->getElementsByTagName("moof")->length;
122                if($moof_len>0)
123                {
124                    $tfdt=$xml_rep_P2->getElementsByTagName("tfdt")->item(0);
125                    $baseMediaDecodeTime_p2=$tfdt->getAttribute("baseMediaDecodeTime");
126                    $mdhd=$xml_rep_P2->getElementsByTagName("mdhd")->item(0);
127                    $timescale_2=$mdhd->getAttribute("timescale");
128                    
129                }
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
131                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: Sequential Switching Sets can be discontinuous, and it is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with baseMediaDecodeTime- ".(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1)." and ".($baseMediaDecodeTime_p2/$timescale_2)." respectively.\n";
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
138    return $errorMsg;
139}
95function checkDiscontinuousSplicePoints($session_dir, $MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
96{
97    $errorMsg="";
98    $period_count=sizeof($MediaProfDatabase);
99    $adapt_count=sizeof($MediaProfDatabase[0]);
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
104            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
105            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
106            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
107            if($xml_rep_P1){
108                $moof_len=$xml_rep_P1->getElementsByTagName("moof")->length;
109                if($moof_len>0)
111                    $tfdt=$xml_rep_P1->getElementsByTagName("tfdt")->item($moof_len-1);
112                    $baseMediaDecodeTime_p1=$tfdt->getAttribute("baseMediaDecodeTime");
113                    $trun=$xml_rep_P1->getElementsByTagName("trun")->item($moof_len-1);
114                    $cummulatedSampleDuration_p1=$trun->getAttribute("cummulatedSampleDuration");
115                    $mdhd=$xml_rep_P1->getElementsByTagName("mdhd")->item(0);
116                    $timescale_1=$mdhd->getAttribute("timescale");
117                }
118            }
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
120            if($xml_rep_P2){
121                $moof_len=$xml_rep_P2->getElementsByTagName("moof")->length;
122                if($moof_len>0)
124                    $tfdt=$xml_rep_P2->getElementsByTagName("tfdt")->item(0);
125                    $baseMediaDecodeTime_p2=$tfdt->getAttribute("baseMediaDecodeTime");
126                    $mdhd=$xml_rep_P2->getElementsByTagName("mdhd")->item(0);
127                    $timescale_2=$mdhd->getAttribute("timescale");
128                    
129                }
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
138    return $errorMsg;
139}
95function checkDiscontinuousSplicePoints($session_dir, $MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
96{
97    $errorMsg="";
98    $period_count=sizeof($MediaProfDatabase);
99    $adapt_count=sizeof($MediaProfDatabase[0]);
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
104            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
105            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
106            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
107            if($xml_rep_P1){
108                $moof_len=$xml_rep_P1->getElementsByTagName("moof")->length;
109                if($moof_len>0)
111                    $tfdt=$xml_rep_P1->getElementsByTagName("tfdt")->item($moof_len-1);
112                    $baseMediaDecodeTime_p1=$tfdt->getAttribute("baseMediaDecodeTime");
113                    $trun=$xml_rep_P1->getElementsByTagName("trun")->item($moof_len-1);
114                    $cummulatedSampleDuration_p1=$trun->getAttribute("cummulatedSampleDuration");
115                    $mdhd=$xml_rep_P1->getElementsByTagName("mdhd")->item(0);
116                    $timescale_1=$mdhd->getAttribute("timescale");
117                }
118            }
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
120            if($xml_rep_P2){
121                $moof_len=$xml_rep_P2->getElementsByTagName("moof")->length;
122                if($moof_len>0)
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
103        {
104            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
105            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
106            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
107            if($xml_rep_P1){
108                $moof_len=$xml_rep_P1->getElementsByTagName("moof")->length;
109                if($moof_len>0)
110                {
111                    $tfdt=$xml_rep_P1->getElementsByTagName("tfdt")->item($moof_len-1);
112                    $baseMediaDecodeTime_p1=$tfdt->getAttribute("baseMediaDecodeTime");
113                    $trun=$xml_rep_P1->getElementsByTagName("trun")->item($moof_len-1);
114                    $cummulatedSampleDuration_p1=$trun->getAttribute("cummulatedSampleDuration");
115                    $mdhd=$xml_rep_P1->getElementsByTagName("mdhd")->item(0);
116                    $timescale_1=$mdhd->getAttribute("timescale");
117                }
118            }
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
120            if($xml_rep_P2){
121                $moof_len=$xml_rep_P2->getElementsByTagName("moof")->length;
122                if($moof_len>0)
123                {
124                    $tfdt=$xml_rep_P2->getElementsByTagName("tfdt")->item(0);
125                    $baseMediaDecodeTime_p2=$tfdt->getAttribute("baseMediaDecodeTime");
126                    $mdhd=$xml_rep_P2->getElementsByTagName("mdhd")->item(0);
127                    $timescale_2=$mdhd->getAttribute("timescale");
128                    
129                }
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
131                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: Sequential Switching Sets can be discontinuous, and it is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with baseMediaDecodeTime- ".(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1)." and ".($baseMediaDecodeTime_p2/$timescale_2)." respectively.\n";
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
138    return $errorMsg;
139}
95function checkDiscontinuousSplicePoints($session_dir, $MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
96{
97    $errorMsg="";
98    $period_count=sizeof($MediaProfDatabase);
99    $adapt_count=sizeof($MediaProfDatabase[0]);
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
104            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
105            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
106            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
107            if($xml_rep_P1){
108                $moof_len=$xml_rep_P1->getElementsByTagName("moof")->length;
109                if($moof_len>0)
111                    $tfdt=$xml_rep_P1->getElementsByTagName("tfdt")->item($moof_len-1);
112                    $baseMediaDecodeTime_p1=$tfdt->getAttribute("baseMediaDecodeTime");
113                    $trun=$xml_rep_P1->getElementsByTagName("trun")->item($moof_len-1);
114                    $cummulatedSampleDuration_p1=$trun->getAttribute("cummulatedSampleDuration");
115                    $mdhd=$xml_rep_P1->getElementsByTagName("mdhd")->item(0);
116                    $timescale_1=$mdhd->getAttribute("timescale");
117                }
118            }
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
120            if($xml_rep_P2){
121                $moof_len=$xml_rep_P2->getElementsByTagName("moof")->length;
122                if($moof_len>0)
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
138    return $errorMsg;
139}
95function checkDiscontinuousSplicePoints($session_dir, $MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
96{
97    $errorMsg="";
98    $period_count=sizeof($MediaProfDatabase);
99    $adapt_count=sizeof($MediaProfDatabase[0]);
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
104            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
105            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
106            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
107            if($xml_rep_P1){
108                $moof_len=$xml_rep_P1->getElementsByTagName("moof")->length;
109                if($moof_len>0)
111                    $tfdt=$xml_rep_P1->getElementsByTagName("tfdt")->item($moof_len-1);
112                    $baseMediaDecodeTime_p1=$tfdt->getAttribute("baseMediaDecodeTime");
113                    $trun=$xml_rep_P1->getElementsByTagName("trun")->item($moof_len-1);
114                    $cummulatedSampleDuration_p1=$trun->getAttribute("cummulatedSampleDuration");
115                    $mdhd=$xml_rep_P1->getElementsByTagName("mdhd")->item(0);
116                    $timescale_1=$mdhd->getAttribute("timescale");
117                }
118            }
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
120            if($xml_rep_P2){
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
138    return $errorMsg;
139}
95function checkDiscontinuousSplicePoints($session_dir, $MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
96{
97    $errorMsg="";
98    $period_count=sizeof($MediaProfDatabase);
99    $adapt_count=sizeof($MediaProfDatabase[0]);
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
104            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
105            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
106            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
107            if($xml_rep_P1){
108                $moof_len=$xml_rep_P1->getElementsByTagName("moof")->length;
109                if($moof_len>0)
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
120            if($xml_rep_P2){
121                $moof_len=$xml_rep_P2->getElementsByTagName("moof")->length;
122                if($moof_len>0)
124                    $tfdt=$xml_rep_P2->getElementsByTagName("tfdt")->item(0);
125                    $baseMediaDecodeTime_p2=$tfdt->getAttribute("baseMediaDecodeTime");
126                    $mdhd=$xml_rep_P2->getElementsByTagName("mdhd")->item(0);
127                    $timescale_2=$mdhd->getAttribute("timescale");
128                    
129                }
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
103        {
104            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
105            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
106            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
107            if($xml_rep_P1){
108                $moof_len=$xml_rep_P1->getElementsByTagName("moof")->length;
109                if($moof_len>0)
110                {
111                    $tfdt=$xml_rep_P1->getElementsByTagName("tfdt")->item($moof_len-1);
112                    $baseMediaDecodeTime_p1=$tfdt->getAttribute("baseMediaDecodeTime");
113                    $trun=$xml_rep_P1->getElementsByTagName("trun")->item($moof_len-1);
114                    $cummulatedSampleDuration_p1=$trun->getAttribute("cummulatedSampleDuration");
115                    $mdhd=$xml_rep_P1->getElementsByTagName("mdhd")->item(0);
116                    $timescale_1=$mdhd->getAttribute("timescale");
117                }
118            }
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
120            if($xml_rep_P2){
121                $moof_len=$xml_rep_P2->getElementsByTagName("moof")->length;
122                if($moof_len>0)
123                {
124                    $tfdt=$xml_rep_P2->getElementsByTagName("tfdt")->item(0);
125                    $baseMediaDecodeTime_p2=$tfdt->getAttribute("baseMediaDecodeTime");
126                    $mdhd=$xml_rep_P2->getElementsByTagName("mdhd")->item(0);
127                    $timescale_2=$mdhd->getAttribute("timescale");
128                    
129                }
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
131                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: Sequential Switching Sets can be discontinuous, and it is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with baseMediaDecodeTime- ".(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1)." and ".($baseMediaDecodeTime_p2/$timescale_2)." respectively.\n";
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
138    return $errorMsg;
139}
95function checkDiscontinuousSplicePoints($session_dir, $MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
96{
97    $errorMsg="";
98    $period_count=sizeof($MediaProfDatabase);
99    $adapt_count=sizeof($MediaProfDatabase[0]);
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
104            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
105            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
106            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
107            if($xml_rep_P1){
108                $moof_len=$xml_rep_P1->getElementsByTagName("moof")->length;
109                if($moof_len>0)
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
120            if($xml_rep_P2){
121                $moof_len=$xml_rep_P2->getElementsByTagName("moof")->length;
122                if($moof_len>0)
124                    $tfdt=$xml_rep_P2->getElementsByTagName("tfdt")->item(0);
125                    $baseMediaDecodeTime_p2=$tfdt->getAttribute("baseMediaDecodeTime");
126                    $mdhd=$xml_rep_P2->getElementsByTagName("mdhd")->item(0);
127                    $timescale_2=$mdhd->getAttribute("timescale");
128                    
129                }
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
138    return $errorMsg;
139}
95function checkDiscontinuousSplicePoints($session_dir, $MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
96{
97    $errorMsg="";
98    $period_count=sizeof($MediaProfDatabase);
99    $adapt_count=sizeof($MediaProfDatabase[0]);
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
104            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
105            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
106            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
107            if($xml_rep_P1){
108                $moof_len=$xml_rep_P1->getElementsByTagName("moof")->length;
109                if($moof_len>0)
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
120            if($xml_rep_P2){
121                $moof_len=$xml_rep_P2->getElementsByTagName("moof")->length;
122                if($moof_len>0)
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
103        {
104            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
105            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
106            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
107            if($xml_rep_P1){
108                $moof_len=$xml_rep_P1->getElementsByTagName("moof")->length;
109                if($moof_len>0)
110                {
111                    $tfdt=$xml_rep_P1->getElementsByTagName("tfdt")->item($moof_len-1);
112                    $baseMediaDecodeTime_p1=$tfdt->getAttribute("baseMediaDecodeTime");
113                    $trun=$xml_rep_P1->getElementsByTagName("trun")->item($moof_len-1);
114                    $cummulatedSampleDuration_p1=$trun->getAttribute("cummulatedSampleDuration");
115                    $mdhd=$xml_rep_P1->getElementsByTagName("mdhd")->item(0);
116                    $timescale_1=$mdhd->getAttribute("timescale");
117                }
118            }
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
120            if($xml_rep_P2){
121                $moof_len=$xml_rep_P2->getElementsByTagName("moof")->length;
122                if($moof_len>0)
123                {
124                    $tfdt=$xml_rep_P2->getElementsByTagName("tfdt")->item(0);
125                    $baseMediaDecodeTime_p2=$tfdt->getAttribute("baseMediaDecodeTime");
126                    $mdhd=$xml_rep_P2->getElementsByTagName("mdhd")->item(0);
127                    $timescale_2=$mdhd->getAttribute("timescale");
128                    
129                }
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
131                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: Sequential Switching Sets can be discontinuous, and it is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with baseMediaDecodeTime- ".(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1)." and ".($baseMediaDecodeTime_p2/$timescale_2)." respectively.\n";
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
138    return $errorMsg;
139}
95function checkDiscontinuousSplicePoints($session_dir, $MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
96{
97    $errorMsg="";
98    $period_count=sizeof($MediaProfDatabase);
99    $adapt_count=sizeof($MediaProfDatabase[0]);
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
104            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
105            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
106            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
107            if($xml_rep_P1){
108                $moof_len=$xml_rep_P1->getElementsByTagName("moof")->length;
109                if($moof_len>0)
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
120            if($xml_rep_P2){
121                $moof_len=$xml_rep_P2->getElementsByTagName("moof")->length;
122                if($moof_len>0)
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
138    return $errorMsg;
139}
95function checkDiscontinuousSplicePoints($session_dir, $MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
96{
97    $errorMsg="";
98    $period_count=sizeof($MediaProfDatabase);
99    $adapt_count=sizeof($MediaProfDatabase[0]);
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
104            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
105            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
106            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
107            if($xml_rep_P1){
108                $moof_len=$xml_rep_P1->getElementsByTagName("moof")->length;
109                if($moof_len>0)
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
120            if($xml_rep_P2){
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
138    return $errorMsg;
139}
95function checkDiscontinuousSplicePoints($session_dir, $MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
96{
97    $errorMsg="";
98    $period_count=sizeof($MediaProfDatabase);
99    $adapt_count=sizeof($MediaProfDatabase[0]);
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
104            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
105            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
106            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
107            if($xml_rep_P1){
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
120            if($xml_rep_P2){
121                $moof_len=$xml_rep_P2->getElementsByTagName("moof")->length;
122                if($moof_len>0)
124                    $tfdt=$xml_rep_P2->getElementsByTagName("tfdt")->item(0);
125                    $baseMediaDecodeTime_p2=$tfdt->getAttribute("baseMediaDecodeTime");
126                    $mdhd=$xml_rep_P2->getElementsByTagName("mdhd")->item(0);
127                    $timescale_2=$mdhd->getAttribute("timescale");
128                    
129                }
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
103        {
104            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
105            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
106            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
107            if($xml_rep_P1){
108                $moof_len=$xml_rep_P1->getElementsByTagName("moof")->length;
109                if($moof_len>0)
110                {
111                    $tfdt=$xml_rep_P1->getElementsByTagName("tfdt")->item($moof_len-1);
112                    $baseMediaDecodeTime_p1=$tfdt->getAttribute("baseMediaDecodeTime");
113                    $trun=$xml_rep_P1->getElementsByTagName("trun")->item($moof_len-1);
114                    $cummulatedSampleDuration_p1=$trun->getAttribute("cummulatedSampleDuration");
115                    $mdhd=$xml_rep_P1->getElementsByTagName("mdhd")->item(0);
116                    $timescale_1=$mdhd->getAttribute("timescale");
117                }
118            }
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
120            if($xml_rep_P2){
121                $moof_len=$xml_rep_P2->getElementsByTagName("moof")->length;
122                if($moof_len>0)
123                {
124                    $tfdt=$xml_rep_P2->getElementsByTagName("tfdt")->item(0);
125                    $baseMediaDecodeTime_p2=$tfdt->getAttribute("baseMediaDecodeTime");
126                    $mdhd=$xml_rep_P2->getElementsByTagName("mdhd")->item(0);
127                    $timescale_2=$mdhd->getAttribute("timescale");
128                    
129                }
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
131                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: Sequential Switching Sets can be discontinuous, and it is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with baseMediaDecodeTime- ".(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1)." and ".($baseMediaDecodeTime_p2/$timescale_2)." respectively.\n";
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
138    return $errorMsg;
139}
95function checkDiscontinuousSplicePoints($session_dir, $MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
96{
97    $errorMsg="";
98    $period_count=sizeof($MediaProfDatabase);
99    $adapt_count=sizeof($MediaProfDatabase[0]);
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
104            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
105            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
106            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
107            if($xml_rep_P1){
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
120            if($xml_rep_P2){
121                $moof_len=$xml_rep_P2->getElementsByTagName("moof")->length;
122                if($moof_len>0)
124                    $tfdt=$xml_rep_P2->getElementsByTagName("tfdt")->item(0);
125                    $baseMediaDecodeTime_p2=$tfdt->getAttribute("baseMediaDecodeTime");
126                    $mdhd=$xml_rep_P2->getElementsByTagName("mdhd")->item(0);
127                    $timescale_2=$mdhd->getAttribute("timescale");
128                    
129                }
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
138    return $errorMsg;
139}
95function checkDiscontinuousSplicePoints($session_dir, $MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
96{
97    $errorMsg="";
98    $period_count=sizeof($MediaProfDatabase);
99    $adapt_count=sizeof($MediaProfDatabase[0]);
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
104            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
105            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
106            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
107            if($xml_rep_P1){
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
120            if($xml_rep_P2){
121                $moof_len=$xml_rep_P2->getElementsByTagName("moof")->length;
122                if($moof_len>0)
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
103        {
104            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
105            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
106            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
107            if($xml_rep_P1){
108                $moof_len=$xml_rep_P1->getElementsByTagName("moof")->length;
109                if($moof_len>0)
110                {
111                    $tfdt=$xml_rep_P1->getElementsByTagName("tfdt")->item($moof_len-1);
112                    $baseMediaDecodeTime_p1=$tfdt->getAttribute("baseMediaDecodeTime");
113                    $trun=$xml_rep_P1->getElementsByTagName("trun")->item($moof_len-1);
114                    $cummulatedSampleDuration_p1=$trun->getAttribute("cummulatedSampleDuration");
115                    $mdhd=$xml_rep_P1->getElementsByTagName("mdhd")->item(0);
116                    $timescale_1=$mdhd->getAttribute("timescale");
117                }
118            }
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
120            if($xml_rep_P2){
121                $moof_len=$xml_rep_P2->getElementsByTagName("moof")->length;
122                if($moof_len>0)
123                {
124                    $tfdt=$xml_rep_P2->getElementsByTagName("tfdt")->item(0);
125                    $baseMediaDecodeTime_p2=$tfdt->getAttribute("baseMediaDecodeTime");
126                    $mdhd=$xml_rep_P2->getElementsByTagName("mdhd")->item(0);
127                    $timescale_2=$mdhd->getAttribute("timescale");
128                    
129                }
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
131                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: Sequential Switching Sets can be discontinuous, and it is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with baseMediaDecodeTime- ".(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1)." and ".($baseMediaDecodeTime_p2/$timescale_2)." respectively.\n";
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
138    return $errorMsg;
139}
95function checkDiscontinuousSplicePoints($session_dir, $MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
96{
97    $errorMsg="";
98    $period_count=sizeof($MediaProfDatabase);
99    $adapt_count=sizeof($MediaProfDatabase[0]);
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
104            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
105            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
106            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
107            if($xml_rep_P1){
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
120            if($xml_rep_P2){
121                $moof_len=$xml_rep_P2->getElementsByTagName("moof")->length;
122                if($moof_len>0)
130                if(($baseMediaDecodeTime_p2/$timescale_2)!=(($baseMediaDecodeTime_p1+$cummulatedSampleDuration_p1)/$timescale_1))
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
138    return $errorMsg;
139}
95function checkDiscontinuousSplicePoints($session_dir, $MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
96{
97    $errorMsg="";
98    $period_count=sizeof($MediaProfDatabase);
99    $adapt_count=sizeof($MediaProfDatabase[0]);
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
104            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
105            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
106            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
107            if($xml_rep_P1){
119            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
120            if($xml_rep_P2){
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
102       for($adapt=0;$adapt<$adapt_count;$adapt++)
100    for($i=0;$i<($period_count-1);$i++)
100    for($i=0;$i<($period_count-1);$i++)
138    return $errorMsg;
139}
checkFragrmentOverlapSplicePoint
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
366        {
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
383                }
384            }
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
389                {
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
391                }
392                else
393                {
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
408                    $errorMsg.="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not have gaps in WAVE Program presentation time at the Splice point', gap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
366        {
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
383                }
384            }
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
389                {
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
391                }
392                else
393                {
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
408                    $errorMsg.="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not have gaps in WAVE Program presentation time at the Splice point', gap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
366        {
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
383                }
384            }
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
389                {
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
391                }
392                else
393                {
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
408                    $errorMsg.="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not have gaps in WAVE Program presentation time at the Splice point', gap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
366        {
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
383                }
384            }
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
389                {
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
391                }
392                else
393                {
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
408                    $errorMsg.="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not have gaps in WAVE Program presentation time at the Splice point', gap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
366        {
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
383                }
384            }
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
389                {
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
391                }
392                else
393                {
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
408                    $errorMsg.="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not have gaps in WAVE Program presentation time at the Splice point', gap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
366        {
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
383                }
384            }
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
389                {
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
391                }
392                else
393                {
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
408                    $errorMsg.="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not have gaps in WAVE Program presentation time at the Splice point', gap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
366        {
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
383                }
384            }
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
389                {
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
391                }
392                else
393                {
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
408                    $errorMsg.="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not have gaps in WAVE Program presentation time at the Splice point', gap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
366        {
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
383                }
384            }
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
389                {
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
391                }
392                else
393                {
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
408                    $errorMsg.="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not have gaps in WAVE Program presentation time at the Splice point', gap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
366        {
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
383                }
384            }
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
389                {
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
391                }
392                else
393                {
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
408                    $errorMsg.="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not have gaps in WAVE Program presentation time at the Splice point', gap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
366        {
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
383                }
384            }
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
389                {
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
391                }
392                else
393                {
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
408                    $errorMsg.="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not have gaps in WAVE Program presentation time at the Splice point', gap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
366        {
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
383                }
384            }
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
389                {
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
391                }
392                else
393                {
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
408                    $errorMsg.="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not have gaps in WAVE Program presentation time at the Splice point', gap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
366        {
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
383                }
384            }
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
389                {
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
391                }
392                else
393                {
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
408                    $errorMsg.="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not have gaps in WAVE Program presentation time at the Splice point', gap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
366        {
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
383                }
384            }
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
389                {
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
391                }
392                else
393                {
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
408                    $errorMsg.="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not have gaps in WAVE Program presentation time at the Splice point', gap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
366        {
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
383                }
384            }
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
389                {
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
391                }
392                else
393                {
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
408                    $errorMsg.="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not have gaps in WAVE Program presentation time at the Splice point', gap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
366        {
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
383                }
384            }
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
389                {
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
391                }
392                else
393                {
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
408                    $errorMsg.="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not have gaps in WAVE Program presentation time at the Splice point', gap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
366        {
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
383                }
384            }
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
389                {
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
391                }
392                else
393                {
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
408                    $errorMsg.="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not have gaps in WAVE Program presentation time at the Splice point', gap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
380                for($j=0;$j<$trun->length;$j++)
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
366        {
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
383                }
384            }
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
389                {
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
391                }
392                else
393                {
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
408                    $errorMsg.="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not have gaps in WAVE Program presentation time at the Splice point', gap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
366        {
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
383                }
384            }
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
389                {
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
391                }
392                else
393                {
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
408                    $errorMsg.="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not have gaps in WAVE Program presentation time at the Splice point', gap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
366        {
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
383                }
384            }
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
389                {
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
391                }
392                else
393                {
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
408                    $errorMsg.="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not have gaps in WAVE Program presentation time at the Splice point', gap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
366        {
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
371                $trun=$xml_rep_P1->getElementsByTagName('trun')->item(0);
372                $earlyCompTime_p1=$trun->getAttribute('earliestCompositionTime');
373                $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
374                $mediaTime_p1=0;
375                if($xml_elst->length>0 ){
376                    $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
377                }
378                $trun=$xml_rep_P1->getElementsByTagName('trun');
379                $sumSampleDur=0;
380                for($j=0;$j<$trun->length;$j++)
381                {
382                    $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
383                }
384            }
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
387                $sidx=$xml_rep_P2->getElementsByTagName('sidx');
388                if($sidx->length>0)
389                {
390                    $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
391                }
392                else
393                {
394                    $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
395                    $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
396                    $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
397                    $mediaTime_p2=0;
398                    if($xml_elst->length>0 ){
399                        $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
400                    }
401                    $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
402                }
403
404            }
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
406                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not overlap the same WAVE Program presentation time at the Splice point', overlap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
408                    $errorMsg.="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'CMAF Fragments Shall not have gaps in WAVE Program presentation time at the Splice point', gap is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur).") and  ".($i+1)." (".$presTime_p2.").\n";
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
358function checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
359{
360    $period_count=sizeof($MediaProfDatabase);
361    $adapt_count=sizeof($MediaProfDatabase[0]);
362    $errorMsg="";
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
367            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
368            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
369            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
370            if($xml_rep_P1){
385            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
386            if($xml_rep_P2){
405            if(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) >$presTime_p2 )
407            elseif(($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur) <$presTime_p2 )
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
365       for($adapt=0;$adapt<$adapt_count;$adapt++)
363    for($i=0;$i<($period_count-1);$i++)
363    for($i=0;$i<($period_count-1);$i++)
413    return $errorMsg;
414}
checkFrameRateSplicePoint
451function checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
452{
453    $period_count=sizeof($MediaProfDatabase);
454    $adapt_count=sizeof($MediaProfDatabase[0]);
455    $errorMsg="";
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
484    return $errorMsg;
485}
451function checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
452{
453    $period_count=sizeof($MediaProfDatabase);
454    $adapt_count=sizeof($MediaProfDatabase[0]);
455    $errorMsg="";
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
484    return $errorMsg;
485}
451function checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
452{
453    $period_count=sizeof($MediaProfDatabase);
454    $adapt_count=sizeof($MediaProfDatabase[0]);
455    $errorMsg="";
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
464                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
465                if($hdlr=="vide")
466                    $framerate_p1=getFrameRate($xml_rep_P1);
467                    
468            }
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
471                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
472                if($hdlr=="vide"){
473                    $framerate_p2=getFrameRate($xml_rep_P2);
474
475            
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
477                    if($remainder !=0)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
459        {
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
464                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
465                if($hdlr=="vide")
466                    $framerate_p1=getFrameRate($xml_rep_P1);
467                    
468            }
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
471                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
472                if($hdlr=="vide"){
473                    $framerate_p2=getFrameRate($xml_rep_P2);
474
475            
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
477                    if($remainder !=0)
478                        $errorMsg="###Warning: WAVE Content Spec 2018Ed-Section 7.2.2: 'Frame rate Should be the same family of multiples between Sequential Sw Sets at the Splice point', violated for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with framerates of ".$framerate_p1." and ".$framerate_p2." respectively.\n";
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
484    return $errorMsg;
485}
451function checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
452{
453    $period_count=sizeof($MediaProfDatabase);
454    $adapt_count=sizeof($MediaProfDatabase[0]);
455    $errorMsg="";
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
464                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
465                if($hdlr=="vide")
466                    $framerate_p1=getFrameRate($xml_rep_P1);
467                    
468            }
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
471                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
472                if($hdlr=="vide"){
473                    $framerate_p2=getFrameRate($xml_rep_P2);
474
475            
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
477                    if($remainder !=0)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
484    return $errorMsg;
485}
451function checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
452{
453    $period_count=sizeof($MediaProfDatabase);
454    $adapt_count=sizeof($MediaProfDatabase[0]);
455    $errorMsg="";
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
464                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
465                if($hdlr=="vide")
466                    $framerate_p1=getFrameRate($xml_rep_P1);
467                    
468            }
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
471                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
472                if($hdlr=="vide"){
473                    $framerate_p2=getFrameRate($xml_rep_P2);
474
475            
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
477                    if($remainder !=0)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
459        {
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
464                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
465                if($hdlr=="vide")
466                    $framerate_p1=getFrameRate($xml_rep_P1);
467                    
468            }
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
471                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
472                if($hdlr=="vide"){
473                    $framerate_p2=getFrameRate($xml_rep_P2);
474
475            
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
477                    if($remainder !=0)
478                        $errorMsg="###Warning: WAVE Content Spec 2018Ed-Section 7.2.2: 'Frame rate Should be the same family of multiples between Sequential Sw Sets at the Splice point', violated for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with framerates of ".$framerate_p1." and ".$framerate_p2." respectively.\n";
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
484    return $errorMsg;
485}
451function checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
452{
453    $period_count=sizeof($MediaProfDatabase);
454    $adapt_count=sizeof($MediaProfDatabase[0]);
455    $errorMsg="";
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
464                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
465                if($hdlr=="vide")
466                    $framerate_p1=getFrameRate($xml_rep_P1);
467                    
468            }
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
471                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
472                if($hdlr=="vide"){
473                    $framerate_p2=getFrameRate($xml_rep_P2);
474
475            
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
477                    if($remainder !=0)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
484    return $errorMsg;
485}
451function checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
452{
453    $period_count=sizeof($MediaProfDatabase);
454    $adapt_count=sizeof($MediaProfDatabase[0]);
455    $errorMsg="";
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
464                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
465                if($hdlr=="vide")
466                    $framerate_p1=getFrameRate($xml_rep_P1);
467                    
468            }
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
471                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
472                if($hdlr=="vide"){
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
484    return $errorMsg;
485}
451function checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
452{
453    $period_count=sizeof($MediaProfDatabase);
454    $adapt_count=sizeof($MediaProfDatabase[0]);
455    $errorMsg="";
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
464                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
465                if($hdlr=="vide")
466                    $framerate_p1=getFrameRate($xml_rep_P1);
467                    
468            }
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
484    return $errorMsg;
485}
451function checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
452{
453    $period_count=sizeof($MediaProfDatabase);
454    $adapt_count=sizeof($MediaProfDatabase[0]);
455    $errorMsg="";
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
464                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
465                if($hdlr=="vide")
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
471                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
472                if($hdlr=="vide"){
473                    $framerate_p2=getFrameRate($xml_rep_P2);
474
475            
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
477                    if($remainder !=0)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
459        {
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
464                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
465                if($hdlr=="vide")
466                    $framerate_p1=getFrameRate($xml_rep_P1);
467                    
468            }
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
471                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
472                if($hdlr=="vide"){
473                    $framerate_p2=getFrameRate($xml_rep_P2);
474
475            
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
477                    if($remainder !=0)
478                        $errorMsg="###Warning: WAVE Content Spec 2018Ed-Section 7.2.2: 'Frame rate Should be the same family of multiples between Sequential Sw Sets at the Splice point', violated for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with framerates of ".$framerate_p1." and ".$framerate_p2." respectively.\n";
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
484    return $errorMsg;
485}
451function checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
452{
453    $period_count=sizeof($MediaProfDatabase);
454    $adapt_count=sizeof($MediaProfDatabase[0]);
455    $errorMsg="";
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
464                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
465                if($hdlr=="vide")
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
471                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
472                if($hdlr=="vide"){
473                    $framerate_p2=getFrameRate($xml_rep_P2);
474
475            
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
477                    if($remainder !=0)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
484    return $errorMsg;
485}
451function checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
452{
453    $period_count=sizeof($MediaProfDatabase);
454    $adapt_count=sizeof($MediaProfDatabase[0]);
455    $errorMsg="";
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
464                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
465                if($hdlr=="vide")
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
471                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
472                if($hdlr=="vide"){
473                    $framerate_p2=getFrameRate($xml_rep_P2);
474
475            
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
477                    if($remainder !=0)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
459        {
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
464                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
465                if($hdlr=="vide")
466                    $framerate_p1=getFrameRate($xml_rep_P1);
467                    
468            }
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
471                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
472                if($hdlr=="vide"){
473                    $framerate_p2=getFrameRate($xml_rep_P2);
474
475            
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
477                    if($remainder !=0)
478                        $errorMsg="###Warning: WAVE Content Spec 2018Ed-Section 7.2.2: 'Frame rate Should be the same family of multiples between Sequential Sw Sets at the Splice point', violated for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with framerates of ".$framerate_p1." and ".$framerate_p2." respectively.\n";
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
484    return $errorMsg;
485}
451function checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
452{
453    $period_count=sizeof($MediaProfDatabase);
454    $adapt_count=sizeof($MediaProfDatabase[0]);
455    $errorMsg="";
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
464                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
465                if($hdlr=="vide")
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
471                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
472                if($hdlr=="vide"){
473                    $framerate_p2=getFrameRate($xml_rep_P2);
474
475            
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
477                    if($remainder !=0)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
484    return $errorMsg;
485}
451function checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
452{
453    $period_count=sizeof($MediaProfDatabase);
454    $adapt_count=sizeof($MediaProfDatabase[0]);
455    $errorMsg="";
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
464                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
465                if($hdlr=="vide")
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
471                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
472                if($hdlr=="vide"){
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
484    return $errorMsg;
485}
451function checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
452{
453    $period_count=sizeof($MediaProfDatabase);
454    $adapt_count=sizeof($MediaProfDatabase[0]);
455    $errorMsg="";
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
464                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
465                if($hdlr=="vide")
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
484    return $errorMsg;
485}
451function checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
452{
453    $period_count=sizeof($MediaProfDatabase);
454    $adapt_count=sizeof($MediaProfDatabase[0]);
455    $errorMsg="";
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
471                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
472                if($hdlr=="vide"){
473                    $framerate_p2=getFrameRate($xml_rep_P2);
474
475            
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
477                    if($remainder !=0)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
459        {
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
464                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
465                if($hdlr=="vide")
466                    $framerate_p1=getFrameRate($xml_rep_P1);
467                    
468            }
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
471                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
472                if($hdlr=="vide"){
473                    $framerate_p2=getFrameRate($xml_rep_P2);
474
475            
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
477                    if($remainder !=0)
478                        $errorMsg="###Warning: WAVE Content Spec 2018Ed-Section 7.2.2: 'Frame rate Should be the same family of multiples between Sequential Sw Sets at the Splice point', violated for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with framerates of ".$framerate_p1." and ".$framerate_p2." respectively.\n";
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
484    return $errorMsg;
485}
451function checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
452{
453    $period_count=sizeof($MediaProfDatabase);
454    $adapt_count=sizeof($MediaProfDatabase[0]);
455    $errorMsg="";
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
471                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
472                if($hdlr=="vide"){
473                    $framerate_p2=getFrameRate($xml_rep_P2);
474
475            
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
477                    if($remainder !=0)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
484    return $errorMsg;
485}
451function checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
452{
453    $period_count=sizeof($MediaProfDatabase);
454    $adapt_count=sizeof($MediaProfDatabase[0]);
455    $errorMsg="";
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
471                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
472                if($hdlr=="vide"){
473                    $framerate_p2=getFrameRate($xml_rep_P2);
474
475            
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
477                    if($remainder !=0)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
459        {
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
464                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
465                if($hdlr=="vide")
466                    $framerate_p1=getFrameRate($xml_rep_P1);
467                    
468            }
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
471                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
472                if($hdlr=="vide"){
473                    $framerate_p2=getFrameRate($xml_rep_P2);
474
475            
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
477                    if($remainder !=0)
478                        $errorMsg="###Warning: WAVE Content Spec 2018Ed-Section 7.2.2: 'Frame rate Should be the same family of multiples between Sequential Sw Sets at the Splice point', violated for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with framerates of ".$framerate_p1." and ".$framerate_p2." respectively.\n";
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
484    return $errorMsg;
485}
451function checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
452{
453    $period_count=sizeof($MediaProfDatabase);
454    $adapt_count=sizeof($MediaProfDatabase[0]);
455    $errorMsg="";
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
471                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
472                if($hdlr=="vide"){
473                    $framerate_p2=getFrameRate($xml_rep_P2);
474
475            
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
476                    $remainder=($framerate_p1>$framerate_p2 ? ($framerate_p1 % $framerate_p2): ($framerate_p2 % $framerate_p1));
477                    if($remainder !=0)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
484    return $errorMsg;
485}
451function checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
452{
453    $period_count=sizeof($MediaProfDatabase);
454    $adapt_count=sizeof($MediaProfDatabase[0]);
455    $errorMsg="";
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
471                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
472                if($hdlr=="vide"){
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
484    return $errorMsg;
485}
451function checkFrameRateSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
452{
453    $period_count=sizeof($MediaProfDatabase);
454    $adapt_count=sizeof($MediaProfDatabase[0]);
455    $errorMsg="";
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
460            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
461            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
462            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
463            if($xml_rep_P1){
469            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
470            if($xml_rep_P2){
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
458       for($adapt=0;$adapt<$adapt_count;$adapt++)
456    for($i=0;$i<($period_count-1);$i++)
456    for($i=0;$i<($period_count-1);$i++)
484    return $errorMsg;
485}
checkPicAspectRatioSplicePoint
416function checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
417{
418    $period_count=sizeof($MediaProfDatabase);
419    $adapt_count=sizeof($MediaProfDatabase[0]);
420    $errorMsg="";
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
449    return $errorMsg;
450}
416function checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
417{
418    $period_count=sizeof($MediaProfDatabase);
419    $adapt_count=sizeof($MediaProfDatabase[0]);
420    $errorMsg="";
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
449    return $errorMsg;
450}
416function checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
417{
418    $period_count=sizeof($MediaProfDatabase);
419    $adapt_count=sizeof($MediaProfDatabase[0]);
420    $errorMsg="";
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
425            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
426            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
427            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
428            if($xml_rep_P1){
429                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd")->item(0);
430                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
431                if($hdlr=="vide")
432                    $par_p1=$tkhd->getAttribute("width")/($tkhd->getAttribute("height"));
433                    
434            }
435            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
435            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
436            if($xml_rep_P2){
437                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd")->item(0);
438                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
439                if($hdlr=="vide"){
440                    $par_p2=$tkhd->getAttribute("width")/($tkhd->getAttribute("height"));
441
442            
443                    if($par_p1!=$par_p2)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
424        {
425            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
426            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
427            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
428            if($xml_rep_P1){
429                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd")->item(0);
430                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
431                if($hdlr=="vide")
432                    $par_p1=$tkhd->getAttribute("width")/($tkhd->getAttribute("height"));
433                    
434            }
435            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
436            if($xml_rep_P2){
437                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd")->item(0);
438                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
439                if($hdlr=="vide"){
440                    $par_p2=$tkhd->getAttribute("width")/($tkhd->getAttribute("height"));
441
442            
443                    if($par_p1!=$par_p2)
444                        $errorMsg="###Warning: WAVE Content Spec 2018Ed-Section 7.2.2: 'Picture Aspect Ratio (PAR) Should be the same between Sequential Sw Sets at the Splice point', violated for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with - PAR ".$par_p1." and ".$par_p2.".\n";
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
449    return $errorMsg;
450}
416function checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
417{
418    $period_count=sizeof($MediaProfDatabase);
419    $adapt_count=sizeof($MediaProfDatabase[0]);
420    $errorMsg="";
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
425            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
426            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
427            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
428            if($xml_rep_P1){
429                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd")->item(0);
430                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
431                if($hdlr=="vide")
432                    $par_p1=$tkhd->getAttribute("width")/($tkhd->getAttribute("height"));
433                    
434            }
435            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
435            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
436            if($xml_rep_P2){
437                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd")->item(0);
438                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
439                if($hdlr=="vide"){
440                    $par_p2=$tkhd->getAttribute("width")/($tkhd->getAttribute("height"));
441
442            
443                    if($par_p1!=$par_p2)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
449    return $errorMsg;
450}
416function checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
417{
418    $period_count=sizeof($MediaProfDatabase);
419    $adapt_count=sizeof($MediaProfDatabase[0]);
420    $errorMsg="";
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
425            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
426            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
427            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
428            if($xml_rep_P1){
429                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd")->item(0);
430                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
431                if($hdlr=="vide")
432                    $par_p1=$tkhd->getAttribute("width")/($tkhd->getAttribute("height"));
433                    
434            }
435            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
435            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
436            if($xml_rep_P2){
437                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd")->item(0);
438                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
439                if($hdlr=="vide"){
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
449    return $errorMsg;
450}
416function checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
417{
418    $period_count=sizeof($MediaProfDatabase);
419    $adapt_count=sizeof($MediaProfDatabase[0]);
420    $errorMsg="";
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
425            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
426            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
427            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
428            if($xml_rep_P1){
429                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd")->item(0);
430                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
431                if($hdlr=="vide")
432                    $par_p1=$tkhd->getAttribute("width")/($tkhd->getAttribute("height"));
433                    
434            }
435            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
435            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
436            if($xml_rep_P2){
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
449    return $errorMsg;
450}
416function checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
417{
418    $period_count=sizeof($MediaProfDatabase);
419    $adapt_count=sizeof($MediaProfDatabase[0]);
420    $errorMsg="";
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
425            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
426            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
427            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
428            if($xml_rep_P1){
429                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd")->item(0);
430                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
431                if($hdlr=="vide")
435            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
436            if($xml_rep_P2){
437                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd")->item(0);
438                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
439                if($hdlr=="vide"){
440                    $par_p2=$tkhd->getAttribute("width")/($tkhd->getAttribute("height"));
441
442            
443                    if($par_p1!=$par_p2)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
424        {
425            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
426            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
427            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
428            if($xml_rep_P1){
429                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd")->item(0);
430                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
431                if($hdlr=="vide")
432                    $par_p1=$tkhd->getAttribute("width")/($tkhd->getAttribute("height"));
433                    
434            }
435            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
436            if($xml_rep_P2){
437                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd")->item(0);
438                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
439                if($hdlr=="vide"){
440                    $par_p2=$tkhd->getAttribute("width")/($tkhd->getAttribute("height"));
441
442            
443                    if($par_p1!=$par_p2)
444                        $errorMsg="###Warning: WAVE Content Spec 2018Ed-Section 7.2.2: 'Picture Aspect Ratio (PAR) Should be the same between Sequential Sw Sets at the Splice point', violated for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with - PAR ".$par_p1." and ".$par_p2.".\n";
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
449    return $errorMsg;
450}
416function checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
417{
418    $period_count=sizeof($MediaProfDatabase);
419    $adapt_count=sizeof($MediaProfDatabase[0]);
420    $errorMsg="";
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
425            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
426            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
427            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
428            if($xml_rep_P1){
429                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd")->item(0);
430                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
431                if($hdlr=="vide")
435            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
436            if($xml_rep_P2){
437                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd")->item(0);
438                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
439                if($hdlr=="vide"){
440                    $par_p2=$tkhd->getAttribute("width")/($tkhd->getAttribute("height"));
441
442            
443                    if($par_p1!=$par_p2)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
449    return $errorMsg;
450}
416function checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
417{
418    $period_count=sizeof($MediaProfDatabase);
419    $adapt_count=sizeof($MediaProfDatabase[0]);
420    $errorMsg="";
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
425            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
426            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
427            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
428            if($xml_rep_P1){
429                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd")->item(0);
430                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
431                if($hdlr=="vide")
435            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
436            if($xml_rep_P2){
437                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd")->item(0);
438                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
439                if($hdlr=="vide"){
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
449    return $errorMsg;
450}
416function checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
417{
418    $period_count=sizeof($MediaProfDatabase);
419    $adapt_count=sizeof($MediaProfDatabase[0]);
420    $errorMsg="";
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
425            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
426            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
427            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
428            if($xml_rep_P1){
429                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd")->item(0);
430                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
431                if($hdlr=="vide")
435            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
436            if($xml_rep_P2){
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
449    return $errorMsg;
450}
416function checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
417{
418    $period_count=sizeof($MediaProfDatabase);
419    $adapt_count=sizeof($MediaProfDatabase[0]);
420    $errorMsg="";
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
425            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
426            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
427            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
428            if($xml_rep_P1){
435            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
436            if($xml_rep_P2){
437                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd")->item(0);
438                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
439                if($hdlr=="vide"){
440                    $par_p2=$tkhd->getAttribute("width")/($tkhd->getAttribute("height"));
441
442            
443                    if($par_p1!=$par_p2)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
424        {
425            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
426            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
427            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
428            if($xml_rep_P1){
429                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd")->item(0);
430                $hdlr=$xml_rep_P1->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
431                if($hdlr=="vide")
432                    $par_p1=$tkhd->getAttribute("width")/($tkhd->getAttribute("height"));
433                    
434            }
435            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
436            if($xml_rep_P2){
437                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd")->item(0);
438                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
439                if($hdlr=="vide"){
440                    $par_p2=$tkhd->getAttribute("width")/($tkhd->getAttribute("height"));
441
442            
443                    if($par_p1!=$par_p2)
444                        $errorMsg="###Warning: WAVE Content Spec 2018Ed-Section 7.2.2: 'Picture Aspect Ratio (PAR) Should be the same between Sequential Sw Sets at the Splice point', violated for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with - PAR ".$par_p1." and ".$par_p2.".\n";
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
449    return $errorMsg;
450}
416function checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
417{
418    $period_count=sizeof($MediaProfDatabase);
419    $adapt_count=sizeof($MediaProfDatabase[0]);
420    $errorMsg="";
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
425            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
426            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
427            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
428            if($xml_rep_P1){
435            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
436            if($xml_rep_P2){
437                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd")->item(0);
438                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
439                if($hdlr=="vide"){
440                    $par_p2=$tkhd->getAttribute("width")/($tkhd->getAttribute("height"));
441
442            
443                    if($par_p1!=$par_p2)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
449    return $errorMsg;
450}
416function checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
417{
418    $period_count=sizeof($MediaProfDatabase);
419    $adapt_count=sizeof($MediaProfDatabase[0]);
420    $errorMsg="";
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
425            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
426            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
427            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
428            if($xml_rep_P1){
435            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
436            if($xml_rep_P2){
437                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd")->item(0);
438                $hdlr=$xml_rep_P2->getElementsByTagName("hdlr")->item(0)->getAttribute("handler_type");
439                if($hdlr=="vide"){
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
449    return $errorMsg;
450}
416function checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
417{
418    $period_count=sizeof($MediaProfDatabase);
419    $adapt_count=sizeof($MediaProfDatabase[0]);
420    $errorMsg="";
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
425            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
426            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
427            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
428            if($xml_rep_P1){
435            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
436            if($xml_rep_P2){
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
423       for($adapt=0;$adapt<$adapt_count;$adapt++)
421    for($i=0;$i<($period_count-1);$i++)
421    for($i=0;$i<($period_count-1);$i++)
449    return $errorMsg;
450}
checkSampleEntryChangeSplicePoint
210function checkSampleEntryChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
211{
212    $errorMsg="";
213    $period_count=sizeof($MediaProfDatabase);
214    $adapt_count=sizeof($MediaProfDatabase[0]);
215    for($i=0;$i<($period_count-1);$i++)
215    for($i=0;$i<($period_count-1);$i++)
237    return $errorMsg;
238}
210function checkSampleEntryChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
211{
212    $errorMsg="";
213    $period_count=sizeof($MediaProfDatabase);
214    $adapt_count=sizeof($MediaProfDatabase[0]);
215    for($i=0;$i<($period_count-1);$i++)
215    for($i=0;$i<($period_count-1);$i++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
215    for($i=0;$i<($period_count-1);$i++)
215    for($i=0;$i<($period_count-1);$i++)
237    return $errorMsg;
238}
210function checkSampleEntryChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
211{
212    $errorMsg="";
213    $period_count=sizeof($MediaProfDatabase);
214    $adapt_count=sizeof($MediaProfDatabase[0]);
215    for($i=0;$i<($period_count-1);$i++)
215    for($i=0;$i<($period_count-1);$i++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
219            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
220            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
221            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
222            if($xml_rep_P1){
223                $sdType_p1=getSdType($xml_rep_P1);
224
225            }
226           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
226           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
227            if($xml_rep_P2){
228                  $sdType_p2=getSdType($xml_rep_P2);
229
230            }
231            if($sdType_p1!=$sdType_p2 )
231            if($sdType_p1!=$sdType_p2 )
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
218        {
219            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
220            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
221            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
222            if($xml_rep_P1){
223                $sdType_p1=getSdType($xml_rep_P1);
224
225            }
226           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
227            if($xml_rep_P2){
228                  $sdType_p2=getSdType($xml_rep_P2);
229
230            }
231            if($sdType_p1!=$sdType_p2 )
232                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'Sample entries in Sequential Switching Sets Shall not change sample type at Splice points', but different sample types ".$sdType_p1." and ".$sdType_p2."observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1).".\n";
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
215    for($i=0;$i<($period_count-1);$i++)
215    for($i=0;$i<($period_count-1);$i++)
237    return $errorMsg;
238}
210function checkSampleEntryChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
211{
212    $errorMsg="";
213    $period_count=sizeof($MediaProfDatabase);
214    $adapt_count=sizeof($MediaProfDatabase[0]);
215    for($i=0;$i<($period_count-1);$i++)
215    for($i=0;$i<($period_count-1);$i++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
219            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
220            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
221            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
222            if($xml_rep_P1){
223                $sdType_p1=getSdType($xml_rep_P1);
224
225            }
226           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
226           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
227            if($xml_rep_P2){
228                  $sdType_p2=getSdType($xml_rep_P2);
229
230            }
231            if($sdType_p1!=$sdType_p2 )
231            if($sdType_p1!=$sdType_p2 )
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
215    for($i=0;$i<($period_count-1);$i++)
215    for($i=0;$i<($period_count-1);$i++)
237    return $errorMsg;
238}
210function checkSampleEntryChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
211{
212    $errorMsg="";
213    $period_count=sizeof($MediaProfDatabase);
214    $adapt_count=sizeof($MediaProfDatabase[0]);
215    for($i=0;$i<($period_count-1);$i++)
215    for($i=0;$i<($period_count-1);$i++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
219            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
220            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
221            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
222            if($xml_rep_P1){
223                $sdType_p1=getSdType($xml_rep_P1);
224
225            }
226           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
226           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
227            if($xml_rep_P2){
231            if($sdType_p1!=$sdType_p2 )
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
218        {
219            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
220            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
221            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
222            if($xml_rep_P1){
223                $sdType_p1=getSdType($xml_rep_P1);
224
225            }
226           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
227            if($xml_rep_P2){
228                  $sdType_p2=getSdType($xml_rep_P2);
229
230            }
231            if($sdType_p1!=$sdType_p2 )
232                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'Sample entries in Sequential Switching Sets Shall not change sample type at Splice points', but different sample types ".$sdType_p1." and ".$sdType_p2."observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1).".\n";
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
215    for($i=0;$i<($period_count-1);$i++)
215    for($i=0;$i<($period_count-1);$i++)
237    return $errorMsg;
238}
210function checkSampleEntryChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
211{
212    $errorMsg="";
213    $period_count=sizeof($MediaProfDatabase);
214    $adapt_count=sizeof($MediaProfDatabase[0]);
215    for($i=0;$i<($period_count-1);$i++)
215    for($i=0;$i<($period_count-1);$i++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
219            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
220            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
221            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
222            if($xml_rep_P1){
223                $sdType_p1=getSdType($xml_rep_P1);
224
225            }
226           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
226           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
227            if($xml_rep_P2){
231            if($sdType_p1!=$sdType_p2 )
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
215    for($i=0;$i<($period_count-1);$i++)
215    for($i=0;$i<($period_count-1);$i++)
237    return $errorMsg;
238}
210function checkSampleEntryChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
211{
212    $errorMsg="";
213    $period_count=sizeof($MediaProfDatabase);
214    $adapt_count=sizeof($MediaProfDatabase[0]);
215    for($i=0;$i<($period_count-1);$i++)
215    for($i=0;$i<($period_count-1);$i++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
219            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
220            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
221            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
222            if($xml_rep_P1){
226           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
227            if($xml_rep_P2){
228                  $sdType_p2=getSdType($xml_rep_P2);
229
230            }
231            if($sdType_p1!=$sdType_p2 )
231            if($sdType_p1!=$sdType_p2 )
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
218        {
219            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
220            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
221            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
222            if($xml_rep_P1){
223                $sdType_p1=getSdType($xml_rep_P1);
224
225            }
226           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
227            if($xml_rep_P2){
228                  $sdType_p2=getSdType($xml_rep_P2);
229
230            }
231            if($sdType_p1!=$sdType_p2 )
232                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'Sample entries in Sequential Switching Sets Shall not change sample type at Splice points', but different sample types ".$sdType_p1." and ".$sdType_p2."observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1).".\n";
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
215    for($i=0;$i<($period_count-1);$i++)
215    for($i=0;$i<($period_count-1);$i++)
237    return $errorMsg;
238}
210function checkSampleEntryChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
211{
212    $errorMsg="";
213    $period_count=sizeof($MediaProfDatabase);
214    $adapt_count=sizeof($MediaProfDatabase[0]);
215    for($i=0;$i<($period_count-1);$i++)
215    for($i=0;$i<($period_count-1);$i++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
219            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
220            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
221            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
222            if($xml_rep_P1){
226           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
227            if($xml_rep_P2){
228                  $sdType_p2=getSdType($xml_rep_P2);
229
230            }
231            if($sdType_p1!=$sdType_p2 )
231            if($sdType_p1!=$sdType_p2 )
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
215    for($i=0;$i<($period_count-1);$i++)
215    for($i=0;$i<($period_count-1);$i++)
237    return $errorMsg;
238}
210function checkSampleEntryChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
211{
212    $errorMsg="";
213    $period_count=sizeof($MediaProfDatabase);
214    $adapt_count=sizeof($MediaProfDatabase[0]);
215    for($i=0;$i<($period_count-1);$i++)
215    for($i=0;$i<($period_count-1);$i++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
219            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
220            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
221            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
222            if($xml_rep_P1){
226           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
227            if($xml_rep_P2){
231            if($sdType_p1!=$sdType_p2 )
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
218        {
219            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
220            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
221            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
222            if($xml_rep_P1){
223                $sdType_p1=getSdType($xml_rep_P1);
224
225            }
226           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
227            if($xml_rep_P2){
228                  $sdType_p2=getSdType($xml_rep_P2);
229
230            }
231            if($sdType_p1!=$sdType_p2 )
232                    $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: 'Sample entries in Sequential Switching Sets Shall not change sample type at Splice points', but different sample types ".$sdType_p1." and ".$sdType_p2."observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1).".\n";
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
215    for($i=0;$i<($period_count-1);$i++)
215    for($i=0;$i<($period_count-1);$i++)
237    return $errorMsg;
238}
210function checkSampleEntryChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
211{
212    $errorMsg="";
213    $period_count=sizeof($MediaProfDatabase);
214    $adapt_count=sizeof($MediaProfDatabase[0]);
215    for($i=0;$i<($period_count-1);$i++)
215    for($i=0;$i<($period_count-1);$i++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
219            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
220            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
221            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
222            if($xml_rep_P1){
226           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
227            if($xml_rep_P2){
231            if($sdType_p1!=$sdType_p2 )
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
217       for($adapt=0;$adapt<$adapt_count;$adapt++)
215    for($i=0;$i<($period_count-1);$i++)
215    for($i=0;$i<($period_count-1);$i++)
237    return $errorMsg;
238}
checkSequentialSwSetMProfile
56function checkSequentialSwSetMProfile($MediaProfDatabase)
57{
58    $errorMsg="";
59    $period_count=sizeof($MediaProfDatabase);
60    //Create an array of media profiles at Sw set level.
61    //If all reps doesnt have same MP, then "unknown" is assigned.
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
81    $adapt_count=sizeof($MediaProf_PeriodAdSet[0]);
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
92    return $errorMsg;
93}
56function checkSequentialSwSetMProfile($MediaProfDatabase)
57{
58    $errorMsg="";
59    $period_count=sizeof($MediaProfDatabase);
60    //Create an array of media profiles at Sw set level.
61    //If all reps doesnt have same MP, then "unknown" is assigned.
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
81    $adapt_count=sizeof($MediaProf_PeriodAdSet[0]);
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
92    return $errorMsg;
93}
56function checkSequentialSwSetMProfile($MediaProfDatabase)
57{
58    $errorMsg="";
59    $period_count=sizeof($MediaProfDatabase);
60    //Create an array of media profiles at Sw set level.
61    //If all reps doesnt have same MP, then "unknown" is assigned.
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
81    $adapt_count=sizeof($MediaProf_PeriodAdSet[0]);
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
86            if($MediaProf_PeriodAdSet[$i][$j]!==$MediaProf_PeriodAdSet[$i+1][$j]){
84        for($j=0;$j<$adapt_count;$j++)
85        {
86            if($MediaProf_PeriodAdSet[$i][$j]!==$MediaProf_PeriodAdSet[$i+1][$j]){
87                $errorMsg="###CTAWAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: Sequential Switching Sets SHALL conform to the same CMAF Media Profile, voilated for Sw set ".$j." between CMAF Presentations ".$i." and  ".($i+1)." with media profiles- '".$MediaProf_PeriodAdSet[$i][$j]."' and '".$MediaProf_PeriodAdSet[$i+1][$j]."' respectively.\n";
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
92    return $errorMsg;
93}
56function checkSequentialSwSetMProfile($MediaProfDatabase)
57{
58    $errorMsg="";
59    $period_count=sizeof($MediaProfDatabase);
60    //Create an array of media profiles at Sw set level.
61    //If all reps doesnt have same MP, then "unknown" is assigned.
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
81    $adapt_count=sizeof($MediaProf_PeriodAdSet[0]);
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
86            if($MediaProf_PeriodAdSet[$i][$j]!==$MediaProf_PeriodAdSet[$i+1][$j]){
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
92    return $errorMsg;
93}
56function checkSequentialSwSetMProfile($MediaProfDatabase)
57{
58    $errorMsg="";
59    $period_count=sizeof($MediaProfDatabase);
60    //Create an array of media profiles at Sw set level.
61    //If all reps doesnt have same MP, then "unknown" is assigned.
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
64        $adapt_count=sizeof($MediaProfDatabase[$i]);
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
81    $adapt_count=sizeof($MediaProf_PeriodAdSet[0]);
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
92    return $errorMsg;
93}
56function checkSequentialSwSetMProfile($MediaProfDatabase)
57{
58    $errorMsg="";
59    $period_count=sizeof($MediaProfDatabase);
60    //Create an array of media profiles at Sw set level.
61    //If all reps doesnt have same MP, then "unknown" is assigned.
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
64        $adapt_count=sizeof($MediaProfDatabase[$i]);
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
81    $adapt_count=sizeof($MediaProf_PeriodAdSet[0]);
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
92    return $errorMsg;
93}
56function checkSequentialSwSetMProfile($MediaProfDatabase)
57{
58    $errorMsg="";
59    $period_count=sizeof($MediaProfDatabase);
60    //Create an array of media profiles at Sw set level.
61    //If all reps doesnt have same MP, then "unknown" is assigned.
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
64        $adapt_count=sizeof($MediaProfDatabase[$i]);
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
81    $adapt_count=sizeof($MediaProf_PeriodAdSet[0]);
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
86            if($MediaProf_PeriodAdSet[$i][$j]!==$MediaProf_PeriodAdSet[$i+1][$j]){
84        for($j=0;$j<$adapt_count;$j++)
85        {
86            if($MediaProf_PeriodAdSet[$i][$j]!==$MediaProf_PeriodAdSet[$i+1][$j]){
87                $errorMsg="###CTAWAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: Sequential Switching Sets SHALL conform to the same CMAF Media Profile, voilated for Sw set ".$j." between CMAF Presentations ".$i." and  ".($i+1)." with media profiles- '".$MediaProf_PeriodAdSet[$i][$j]."' and '".$MediaProf_PeriodAdSet[$i+1][$j]."' respectively.\n";
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
92    return $errorMsg;
93}
56function checkSequentialSwSetMProfile($MediaProfDatabase)
57{
58    $errorMsg="";
59    $period_count=sizeof($MediaProfDatabase);
60    //Create an array of media profiles at Sw set level.
61    //If all reps doesnt have same MP, then "unknown" is assigned.
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
64        $adapt_count=sizeof($MediaProfDatabase[$i]);
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
81    $adapt_count=sizeof($MediaProf_PeriodAdSet[0]);
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
86            if($MediaProf_PeriodAdSet[$i][$j]!==$MediaProf_PeriodAdSet[$i+1][$j]){
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
92    return $errorMsg;
93}
56function checkSequentialSwSetMProfile($MediaProfDatabase)
57{
58    $errorMsg="";
59    $period_count=sizeof($MediaProfDatabase);
60    //Create an array of media profiles at Sw set level.
61    //If all reps doesnt have same MP, then "unknown" is assigned.
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
64        $adapt_count=sizeof($MediaProfDatabase[$i]);
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
67            $rep_count=sizeof($MediaProfDatabase[$i][$j]);
68            $MediaProf_PeriodAdSet[$i][$j]=$MediaProfDatabase[$i][$j][0];
69            for($k=0;$k<($rep_count-1);$k++)
69            for($k=0;$k<($rep_count-1);$k++)
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
81    $adapt_count=sizeof($MediaProf_PeriodAdSet[0]);
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
92    return $errorMsg;
93}
56function checkSequentialSwSetMProfile($MediaProfDatabase)
57{
58    $errorMsg="";
59    $period_count=sizeof($MediaProfDatabase);
60    //Create an array of media profiles at Sw set level.
61    //If all reps doesnt have same MP, then "unknown" is assigned.
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
64        $adapt_count=sizeof($MediaProfDatabase[$i]);
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
67            $rep_count=sizeof($MediaProfDatabase[$i][$j]);
68            $MediaProf_PeriodAdSet[$i][$j]=$MediaProfDatabase[$i][$j][0];
69            for($k=0;$k<($rep_count-1);$k++)
69            for($k=0;$k<($rep_count-1);$k++)
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
81    $adapt_count=sizeof($MediaProf_PeriodAdSet[0]);
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
92    return $errorMsg;
93}
56function checkSequentialSwSetMProfile($MediaProfDatabase)
57{
58    $errorMsg="";
59    $period_count=sizeof($MediaProfDatabase);
60    //Create an array of media profiles at Sw set level.
61    //If all reps doesnt have same MP, then "unknown" is assigned.
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
64        $adapt_count=sizeof($MediaProfDatabase[$i]);
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
67            $rep_count=sizeof($MediaProfDatabase[$i][$j]);
68            $MediaProf_PeriodAdSet[$i][$j]=$MediaProfDatabase[$i][$j][0];
69            for($k=0;$k<($rep_count-1);$k++)
69            for($k=0;$k<($rep_count-1);$k++)
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
81    $adapt_count=sizeof($MediaProf_PeriodAdSet[0]);
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
86            if($MediaProf_PeriodAdSet[$i][$j]!==$MediaProf_PeriodAdSet[$i+1][$j]){
84        for($j=0;$j<$adapt_count;$j++)
85        {
86            if($MediaProf_PeriodAdSet[$i][$j]!==$MediaProf_PeriodAdSet[$i+1][$j]){
87                $errorMsg="###CTAWAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: Sequential Switching Sets SHALL conform to the same CMAF Media Profile, voilated for Sw set ".$j." between CMAF Presentations ".$i." and  ".($i+1)." with media profiles- '".$MediaProf_PeriodAdSet[$i][$j]."' and '".$MediaProf_PeriodAdSet[$i+1][$j]."' respectively.\n";
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
92    return $errorMsg;
93}
56function checkSequentialSwSetMProfile($MediaProfDatabase)
57{
58    $errorMsg="";
59    $period_count=sizeof($MediaProfDatabase);
60    //Create an array of media profiles at Sw set level.
61    //If all reps doesnt have same MP, then "unknown" is assigned.
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
64        $adapt_count=sizeof($MediaProfDatabase[$i]);
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
67            $rep_count=sizeof($MediaProfDatabase[$i][$j]);
68            $MediaProf_PeriodAdSet[$i][$j]=$MediaProfDatabase[$i][$j][0];
69            for($k=0;$k<($rep_count-1);$k++)
69            for($k=0;$k<($rep_count-1);$k++)
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
81    $adapt_count=sizeof($MediaProf_PeriodAdSet[0]);
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
86            if($MediaProf_PeriodAdSet[$i][$j]!==$MediaProf_PeriodAdSet[$i+1][$j]){
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
92    return $errorMsg;
93}
56function checkSequentialSwSetMProfile($MediaProfDatabase)
57{
58    $errorMsg="";
59    $period_count=sizeof($MediaProfDatabase);
60    //Create an array of media profiles at Sw set level.
61    //If all reps doesnt have same MP, then "unknown" is assigned.
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
64        $adapt_count=sizeof($MediaProfDatabase[$i]);
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
67            $rep_count=sizeof($MediaProfDatabase[$i][$j]);
68            $MediaProf_PeriodAdSet[$i][$j]=$MediaProfDatabase[$i][$j][0];
69            for($k=0;$k<($rep_count-1);$k++)
69            for($k=0;$k<($rep_count-1);$k++)
71                if($MediaProfDatabase[$i][$j][$k]!==$MediaProfDatabase[$i][$j][$k+1])
73                    $MediaProf_PeriodAdSet[$i][$j]="unknown";
74                    break;
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
81    $adapt_count=sizeof($MediaProf_PeriodAdSet[0]);
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
92    return $errorMsg;
93}
56function checkSequentialSwSetMProfile($MediaProfDatabase)
57{
58    $errorMsg="";
59    $period_count=sizeof($MediaProfDatabase);
60    //Create an array of media profiles at Sw set level.
61    //If all reps doesnt have same MP, then "unknown" is assigned.
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
64        $adapt_count=sizeof($MediaProfDatabase[$i]);
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
67            $rep_count=sizeof($MediaProfDatabase[$i][$j]);
68            $MediaProf_PeriodAdSet[$i][$j]=$MediaProfDatabase[$i][$j][0];
69            for($k=0;$k<($rep_count-1);$k++)
69            for($k=0;$k<($rep_count-1);$k++)
71                if($MediaProfDatabase[$i][$j][$k]!==$MediaProfDatabase[$i][$j][$k+1])
73                    $MediaProf_PeriodAdSet[$i][$j]="unknown";
74                    break;
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
81    $adapt_count=sizeof($MediaProf_PeriodAdSet[0]);
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
92    return $errorMsg;
93}
56function checkSequentialSwSetMProfile($MediaProfDatabase)
57{
58    $errorMsg="";
59    $period_count=sizeof($MediaProfDatabase);
60    //Create an array of media profiles at Sw set level.
61    //If all reps doesnt have same MP, then "unknown" is assigned.
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
64        $adapt_count=sizeof($MediaProfDatabase[$i]);
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
67            $rep_count=sizeof($MediaProfDatabase[$i][$j]);
68            $MediaProf_PeriodAdSet[$i][$j]=$MediaProfDatabase[$i][$j][0];
69            for($k=0;$k<($rep_count-1);$k++)
69            for($k=0;$k<($rep_count-1);$k++)
71                if($MediaProfDatabase[$i][$j][$k]!==$MediaProfDatabase[$i][$j][$k+1])
73                    $MediaProf_PeriodAdSet[$i][$j]="unknown";
74                    break;
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
81    $adapt_count=sizeof($MediaProf_PeriodAdSet[0]);
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
86            if($MediaProf_PeriodAdSet[$i][$j]!==$MediaProf_PeriodAdSet[$i+1][$j]){
84        for($j=0;$j<$adapt_count;$j++)
85        {
86            if($MediaProf_PeriodAdSet[$i][$j]!==$MediaProf_PeriodAdSet[$i+1][$j]){
87                $errorMsg="###CTAWAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: Sequential Switching Sets SHALL conform to the same CMAF Media Profile, voilated for Sw set ".$j." between CMAF Presentations ".$i." and  ".($i+1)." with media profiles- '".$MediaProf_PeriodAdSet[$i][$j]."' and '".$MediaProf_PeriodAdSet[$i+1][$j]."' respectively.\n";
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
92    return $errorMsg;
93}
56function checkSequentialSwSetMProfile($MediaProfDatabase)
57{
58    $errorMsg="";
59    $period_count=sizeof($MediaProfDatabase);
60    //Create an array of media profiles at Sw set level.
61    //If all reps doesnt have same MP, then "unknown" is assigned.
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
64        $adapt_count=sizeof($MediaProfDatabase[$i]);
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
67            $rep_count=sizeof($MediaProfDatabase[$i][$j]);
68            $MediaProf_PeriodAdSet[$i][$j]=$MediaProfDatabase[$i][$j][0];
69            for($k=0;$k<($rep_count-1);$k++)
69            for($k=0;$k<($rep_count-1);$k++)
71                if($MediaProfDatabase[$i][$j][$k]!==$MediaProfDatabase[$i][$j][$k+1])
73                    $MediaProf_PeriodAdSet[$i][$j]="unknown";
74                    break;
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
81    $adapt_count=sizeof($MediaProf_PeriodAdSet[0]);
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
86            if($MediaProf_PeriodAdSet[$i][$j]!==$MediaProf_PeriodAdSet[$i+1][$j]){
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
92    return $errorMsg;
93}
56function checkSequentialSwSetMProfile($MediaProfDatabase)
57{
58    $errorMsg="";
59    $period_count=sizeof($MediaProfDatabase);
60    //Create an array of media profiles at Sw set level.
61    //If all reps doesnt have same MP, then "unknown" is assigned.
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
64        $adapt_count=sizeof($MediaProfDatabase[$i]);
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
67            $rep_count=sizeof($MediaProfDatabase[$i][$j]);
68            $MediaProf_PeriodAdSet[$i][$j]=$MediaProfDatabase[$i][$j][0];
69            for($k=0;$k<($rep_count-1);$k++)
69            for($k=0;$k<($rep_count-1);$k++)
71                if($MediaProfDatabase[$i][$j][$k]!==$MediaProfDatabase[$i][$j][$k+1])
69            for($k=0;$k<($rep_count-1);$k++)
69            for($k=0;$k<($rep_count-1);$k++)
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
81    $adapt_count=sizeof($MediaProf_PeriodAdSet[0]);
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
92    return $errorMsg;
93}
56function checkSequentialSwSetMProfile($MediaProfDatabase)
57{
58    $errorMsg="";
59    $period_count=sizeof($MediaProfDatabase);
60    //Create an array of media profiles at Sw set level.
61    //If all reps doesnt have same MP, then "unknown" is assigned.
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
64        $adapt_count=sizeof($MediaProfDatabase[$i]);
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
67            $rep_count=sizeof($MediaProfDatabase[$i][$j]);
68            $MediaProf_PeriodAdSet[$i][$j]=$MediaProfDatabase[$i][$j][0];
69            for($k=0;$k<($rep_count-1);$k++)
69            for($k=0;$k<($rep_count-1);$k++)
71                if($MediaProfDatabase[$i][$j][$k]!==$MediaProfDatabase[$i][$j][$k+1])
69            for($k=0;$k<($rep_count-1);$k++)
69            for($k=0;$k<($rep_count-1);$k++)
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
81    $adapt_count=sizeof($MediaProf_PeriodAdSet[0]);
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
92    return $errorMsg;
93}
56function checkSequentialSwSetMProfile($MediaProfDatabase)
57{
58    $errorMsg="";
59    $period_count=sizeof($MediaProfDatabase);
60    //Create an array of media profiles at Sw set level.
61    //If all reps doesnt have same MP, then "unknown" is assigned.
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
64        $adapt_count=sizeof($MediaProfDatabase[$i]);
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
67            $rep_count=sizeof($MediaProfDatabase[$i][$j]);
68            $MediaProf_PeriodAdSet[$i][$j]=$MediaProfDatabase[$i][$j][0];
69            for($k=0;$k<($rep_count-1);$k++)
69            for($k=0;$k<($rep_count-1);$k++)
71                if($MediaProfDatabase[$i][$j][$k]!==$MediaProfDatabase[$i][$j][$k+1])
69            for($k=0;$k<($rep_count-1);$k++)
69            for($k=0;$k<($rep_count-1);$k++)
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
81    $adapt_count=sizeof($MediaProf_PeriodAdSet[0]);
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
86            if($MediaProf_PeriodAdSet[$i][$j]!==$MediaProf_PeriodAdSet[$i+1][$j]){
84        for($j=0;$j<$adapt_count;$j++)
85        {
86            if($MediaProf_PeriodAdSet[$i][$j]!==$MediaProf_PeriodAdSet[$i+1][$j]){
87                $errorMsg="###CTAWAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: Sequential Switching Sets SHALL conform to the same CMAF Media Profile, voilated for Sw set ".$j." between CMAF Presentations ".$i." and  ".($i+1)." with media profiles- '".$MediaProf_PeriodAdSet[$i][$j]."' and '".$MediaProf_PeriodAdSet[$i+1][$j]."' respectively.\n";
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
92    return $errorMsg;
93}
56function checkSequentialSwSetMProfile($MediaProfDatabase)
57{
58    $errorMsg="";
59    $period_count=sizeof($MediaProfDatabase);
60    //Create an array of media profiles at Sw set level.
61    //If all reps doesnt have same MP, then "unknown" is assigned.
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
64        $adapt_count=sizeof($MediaProfDatabase[$i]);
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
67            $rep_count=sizeof($MediaProfDatabase[$i][$j]);
68            $MediaProf_PeriodAdSet[$i][$j]=$MediaProfDatabase[$i][$j][0];
69            for($k=0;$k<($rep_count-1);$k++)
69            for($k=0;$k<($rep_count-1);$k++)
71                if($MediaProfDatabase[$i][$j][$k]!==$MediaProfDatabase[$i][$j][$k+1])
69            for($k=0;$k<($rep_count-1);$k++)
69            for($k=0;$k<($rep_count-1);$k++)
65        for($j=0;$j<$adapt_count;$j++)
65        for($j=0;$j<$adapt_count;$j++)
62    for($i=0;$i<$period_count;$i++)
62    for($i=0;$i<$period_count;$i++)
81    $adapt_count=sizeof($MediaProf_PeriodAdSet[0]);
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
86            if($MediaProf_PeriodAdSet[$i][$j]!==$MediaProf_PeriodAdSet[$i+1][$j]){
84        for($j=0;$j<$adapt_count;$j++)
84        for($j=0;$j<$adapt_count;$j++)
82    for($i=0;$i<($period_count-1);$i++)
82    for($i=0;$i<($period_count-1);$i++)
92    return $errorMsg;
93}
checkTimeScaleChangeSplicePoint
324function checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
325{
326    $period_count=sizeof($MediaProfDatabase);
327    $adapt_count=sizeof($MediaProfDatabase[0]);
328    $errorMsg="";
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
355    return $errorMsg;
356}
324function checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
325{
326    $period_count=sizeof($MediaProfDatabase);
327    $adapt_count=sizeof($MediaProfDatabase[0]);
328    $errorMsg="";
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
355    return $errorMsg;
356}
324function checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
325{
326    $period_count=sizeof($MediaProfDatabase);
327    $adapt_count=sizeof($MediaProfDatabase[0]);
328    $errorMsg="";
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
337                $mvhd=$xml_rep_P1->getElementsByTagName("mvhd");
338                if($mvhd->length>0)
339                  $timescale_p1=$mvhd->item(0)->getAttribute("timeScale");
340               
341            }
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
344                $mvhd=$xml_rep_P2->getElementsByTagName("mvhd");
345                if($mvhd->length>0)
346                  $timescale_p2=$mvhd->item(0)->getAttribute("timeScale");
347
348            }
349            if($timescale_p1!=$timescale_p2 )
349            if($timescale_p1!=$timescale_p2 )
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
332        {
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
337                $mvhd=$xml_rep_P1->getElementsByTagName("mvhd");
338                if($mvhd->length>0)
339                  $timescale_p1=$mvhd->item(0)->getAttribute("timeScale");
340               
341            }
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
344                $mvhd=$xml_rep_P2->getElementsByTagName("mvhd");
345                if($mvhd->length>0)
346                  $timescale_p2=$mvhd->item(0)->getAttribute("timeScale");
347
348            }
349            if($timescale_p1!=$timescale_p2 )
350                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Timescale can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with timescale ".$timescale_p1." and ".$timescale_p1." respectively.\n";
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
355    return $errorMsg;
356}
324function checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
325{
326    $period_count=sizeof($MediaProfDatabase);
327    $adapt_count=sizeof($MediaProfDatabase[0]);
328    $errorMsg="";
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
337                $mvhd=$xml_rep_P1->getElementsByTagName("mvhd");
338                if($mvhd->length>0)
339                  $timescale_p1=$mvhd->item(0)->getAttribute("timeScale");
340               
341            }
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
344                $mvhd=$xml_rep_P2->getElementsByTagName("mvhd");
345                if($mvhd->length>0)
346                  $timescale_p2=$mvhd->item(0)->getAttribute("timeScale");
347
348            }
349            if($timescale_p1!=$timescale_p2 )
349            if($timescale_p1!=$timescale_p2 )
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
355    return $errorMsg;
356}
324function checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
325{
326    $period_count=sizeof($MediaProfDatabase);
327    $adapt_count=sizeof($MediaProfDatabase[0]);
328    $errorMsg="";
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
337                $mvhd=$xml_rep_P1->getElementsByTagName("mvhd");
338                if($mvhd->length>0)
339                  $timescale_p1=$mvhd->item(0)->getAttribute("timeScale");
340               
341            }
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
344                $mvhd=$xml_rep_P2->getElementsByTagName("mvhd");
345                if($mvhd->length>0)
349            if($timescale_p1!=$timescale_p2 )
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
332        {
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
337                $mvhd=$xml_rep_P1->getElementsByTagName("mvhd");
338                if($mvhd->length>0)
339                  $timescale_p1=$mvhd->item(0)->getAttribute("timeScale");
340               
341            }
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
344                $mvhd=$xml_rep_P2->getElementsByTagName("mvhd");
345                if($mvhd->length>0)
346                  $timescale_p2=$mvhd->item(0)->getAttribute("timeScale");
347
348            }
349            if($timescale_p1!=$timescale_p2 )
350                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Timescale can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with timescale ".$timescale_p1." and ".$timescale_p1." respectively.\n";
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
355    return $errorMsg;
356}
324function checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
325{
326    $period_count=sizeof($MediaProfDatabase);
327    $adapt_count=sizeof($MediaProfDatabase[0]);
328    $errorMsg="";
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
337                $mvhd=$xml_rep_P1->getElementsByTagName("mvhd");
338                if($mvhd->length>0)
339                  $timescale_p1=$mvhd->item(0)->getAttribute("timeScale");
340               
341            }
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
344                $mvhd=$xml_rep_P2->getElementsByTagName("mvhd");
345                if($mvhd->length>0)
349            if($timescale_p1!=$timescale_p2 )
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
355    return $errorMsg;
356}
324function checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
325{
326    $period_count=sizeof($MediaProfDatabase);
327    $adapt_count=sizeof($MediaProfDatabase[0]);
328    $errorMsg="";
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
337                $mvhd=$xml_rep_P1->getElementsByTagName("mvhd");
338                if($mvhd->length>0)
339                  $timescale_p1=$mvhd->item(0)->getAttribute("timeScale");
340               
341            }
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
349            if($timescale_p1!=$timescale_p2 )
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
332        {
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
337                $mvhd=$xml_rep_P1->getElementsByTagName("mvhd");
338                if($mvhd->length>0)
339                  $timescale_p1=$mvhd->item(0)->getAttribute("timeScale");
340               
341            }
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
344                $mvhd=$xml_rep_P2->getElementsByTagName("mvhd");
345                if($mvhd->length>0)
346                  $timescale_p2=$mvhd->item(0)->getAttribute("timeScale");
347
348            }
349            if($timescale_p1!=$timescale_p2 )
350                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Timescale can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with timescale ".$timescale_p1." and ".$timescale_p1." respectively.\n";
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
355    return $errorMsg;
356}
324function checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
325{
326    $period_count=sizeof($MediaProfDatabase);
327    $adapt_count=sizeof($MediaProfDatabase[0]);
328    $errorMsg="";
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
337                $mvhd=$xml_rep_P1->getElementsByTagName("mvhd");
338                if($mvhd->length>0)
339                  $timescale_p1=$mvhd->item(0)->getAttribute("timeScale");
340               
341            }
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
349            if($timescale_p1!=$timescale_p2 )
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
355    return $errorMsg;
356}
324function checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
325{
326    $period_count=sizeof($MediaProfDatabase);
327    $adapt_count=sizeof($MediaProfDatabase[0]);
328    $errorMsg="";
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
337                $mvhd=$xml_rep_P1->getElementsByTagName("mvhd");
338                if($mvhd->length>0)
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
344                $mvhd=$xml_rep_P2->getElementsByTagName("mvhd");
345                if($mvhd->length>0)
346                  $timescale_p2=$mvhd->item(0)->getAttribute("timeScale");
347
348            }
349            if($timescale_p1!=$timescale_p2 )
349            if($timescale_p1!=$timescale_p2 )
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
332        {
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
337                $mvhd=$xml_rep_P1->getElementsByTagName("mvhd");
338                if($mvhd->length>0)
339                  $timescale_p1=$mvhd->item(0)->getAttribute("timeScale");
340               
341            }
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
344                $mvhd=$xml_rep_P2->getElementsByTagName("mvhd");
345                if($mvhd->length>0)
346                  $timescale_p2=$mvhd->item(0)->getAttribute("timeScale");
347
348            }
349            if($timescale_p1!=$timescale_p2 )
350                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Timescale can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with timescale ".$timescale_p1." and ".$timescale_p1." respectively.\n";
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
355    return $errorMsg;
356}
324function checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
325{
326    $period_count=sizeof($MediaProfDatabase);
327    $adapt_count=sizeof($MediaProfDatabase[0]);
328    $errorMsg="";
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
337                $mvhd=$xml_rep_P1->getElementsByTagName("mvhd");
338                if($mvhd->length>0)
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
344                $mvhd=$xml_rep_P2->getElementsByTagName("mvhd");
345                if($mvhd->length>0)
346                  $timescale_p2=$mvhd->item(0)->getAttribute("timeScale");
347
348            }
349            if($timescale_p1!=$timescale_p2 )
349            if($timescale_p1!=$timescale_p2 )
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
355    return $errorMsg;
356}
324function checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
325{
326    $period_count=sizeof($MediaProfDatabase);
327    $adapt_count=sizeof($MediaProfDatabase[0]);
328    $errorMsg="";
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
337                $mvhd=$xml_rep_P1->getElementsByTagName("mvhd");
338                if($mvhd->length>0)
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
344                $mvhd=$xml_rep_P2->getElementsByTagName("mvhd");
345                if($mvhd->length>0)
349            if($timescale_p1!=$timescale_p2 )
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
332        {
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
337                $mvhd=$xml_rep_P1->getElementsByTagName("mvhd");
338                if($mvhd->length>0)
339                  $timescale_p1=$mvhd->item(0)->getAttribute("timeScale");
340               
341            }
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
344                $mvhd=$xml_rep_P2->getElementsByTagName("mvhd");
345                if($mvhd->length>0)
346                  $timescale_p2=$mvhd->item(0)->getAttribute("timeScale");
347
348            }
349            if($timescale_p1!=$timescale_p2 )
350                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Timescale can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with timescale ".$timescale_p1." and ".$timescale_p1." respectively.\n";
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
355    return $errorMsg;
356}
324function checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
325{
326    $period_count=sizeof($MediaProfDatabase);
327    $adapt_count=sizeof($MediaProfDatabase[0]);
328    $errorMsg="";
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
337                $mvhd=$xml_rep_P1->getElementsByTagName("mvhd");
338                if($mvhd->length>0)
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
344                $mvhd=$xml_rep_P2->getElementsByTagName("mvhd");
345                if($mvhd->length>0)
349            if($timescale_p1!=$timescale_p2 )
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
355    return $errorMsg;
356}
324function checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
325{
326    $period_count=sizeof($MediaProfDatabase);
327    $adapt_count=sizeof($MediaProfDatabase[0]);
328    $errorMsg="";
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
337                $mvhd=$xml_rep_P1->getElementsByTagName("mvhd");
338                if($mvhd->length>0)
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
349            if($timescale_p1!=$timescale_p2 )
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
332        {
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
337                $mvhd=$xml_rep_P1->getElementsByTagName("mvhd");
338                if($mvhd->length>0)
339                  $timescale_p1=$mvhd->item(0)->getAttribute("timeScale");
340               
341            }
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
344                $mvhd=$xml_rep_P2->getElementsByTagName("mvhd");
345                if($mvhd->length>0)
346                  $timescale_p2=$mvhd->item(0)->getAttribute("timeScale");
347
348            }
349            if($timescale_p1!=$timescale_p2 )
350                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Timescale can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with timescale ".$timescale_p1." and ".$timescale_p1." respectively.\n";
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
355    return $errorMsg;
356}
324function checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
325{
326    $period_count=sizeof($MediaProfDatabase);
327    $adapt_count=sizeof($MediaProfDatabase[0]);
328    $errorMsg="";
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
337                $mvhd=$xml_rep_P1->getElementsByTagName("mvhd");
338                if($mvhd->length>0)
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
349            if($timescale_p1!=$timescale_p2 )
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
355    return $errorMsg;
356}
324function checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
325{
326    $period_count=sizeof($MediaProfDatabase);
327    $adapt_count=sizeof($MediaProfDatabase[0]);
328    $errorMsg="";
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
344                $mvhd=$xml_rep_P2->getElementsByTagName("mvhd");
345                if($mvhd->length>0)
346                  $timescale_p2=$mvhd->item(0)->getAttribute("timeScale");
347
348            }
349            if($timescale_p1!=$timescale_p2 )
349            if($timescale_p1!=$timescale_p2 )
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
332        {
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
337                $mvhd=$xml_rep_P1->getElementsByTagName("mvhd");
338                if($mvhd->length>0)
339                  $timescale_p1=$mvhd->item(0)->getAttribute("timeScale");
340               
341            }
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
344                $mvhd=$xml_rep_P2->getElementsByTagName("mvhd");
345                if($mvhd->length>0)
346                  $timescale_p2=$mvhd->item(0)->getAttribute("timeScale");
347
348            }
349            if($timescale_p1!=$timescale_p2 )
350                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Timescale can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with timescale ".$timescale_p1." and ".$timescale_p1." respectively.\n";
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
355    return $errorMsg;
356}
324function checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
325{
326    $period_count=sizeof($MediaProfDatabase);
327    $adapt_count=sizeof($MediaProfDatabase[0]);
328    $errorMsg="";
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
344                $mvhd=$xml_rep_P2->getElementsByTagName("mvhd");
345                if($mvhd->length>0)
346                  $timescale_p2=$mvhd->item(0)->getAttribute("timeScale");
347
348            }
349            if($timescale_p1!=$timescale_p2 )
349            if($timescale_p1!=$timescale_p2 )
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
355    return $errorMsg;
356}
324function checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
325{
326    $period_count=sizeof($MediaProfDatabase);
327    $adapt_count=sizeof($MediaProfDatabase[0]);
328    $errorMsg="";
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
344                $mvhd=$xml_rep_P2->getElementsByTagName("mvhd");
345                if($mvhd->length>0)
349            if($timescale_p1!=$timescale_p2 )
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
332        {
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
337                $mvhd=$xml_rep_P1->getElementsByTagName("mvhd");
338                if($mvhd->length>0)
339                  $timescale_p1=$mvhd->item(0)->getAttribute("timeScale");
340               
341            }
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
344                $mvhd=$xml_rep_P2->getElementsByTagName("mvhd");
345                if($mvhd->length>0)
346                  $timescale_p2=$mvhd->item(0)->getAttribute("timeScale");
347
348            }
349            if($timescale_p1!=$timescale_p2 )
350                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Timescale can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with timescale ".$timescale_p1." and ".$timescale_p1." respectively.\n";
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
355    return $errorMsg;
356}
324function checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
325{
326    $period_count=sizeof($MediaProfDatabase);
327    $adapt_count=sizeof($MediaProfDatabase[0]);
328    $errorMsg="";
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
344                $mvhd=$xml_rep_P2->getElementsByTagName("mvhd");
345                if($mvhd->length>0)
349            if($timescale_p1!=$timescale_p2 )
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
355    return $errorMsg;
356}
324function checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
325{
326    $period_count=sizeof($MediaProfDatabase);
327    $adapt_count=sizeof($MediaProfDatabase[0]);
328    $errorMsg="";
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
349            if($timescale_p1!=$timescale_p2 )
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
332        {
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
337                $mvhd=$xml_rep_P1->getElementsByTagName("mvhd");
338                if($mvhd->length>0)
339                  $timescale_p1=$mvhd->item(0)->getAttribute("timeScale");
340               
341            }
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
344                $mvhd=$xml_rep_P2->getElementsByTagName("mvhd");
345                if($mvhd->length>0)
346                  $timescale_p2=$mvhd->item(0)->getAttribute("timeScale");
347
348            }
349            if($timescale_p1!=$timescale_p2 )
350                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Timescale can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with timescale ".$timescale_p1." and ".$timescale_p1." respectively.\n";
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
355    return $errorMsg;
356}
324function checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
325{
326    $period_count=sizeof($MediaProfDatabase);
327    $adapt_count=sizeof($MediaProfDatabase[0]);
328    $errorMsg="";
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
333            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
334            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
335            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
336            if($xml_rep_P1){
342            $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
343            if($xml_rep_P2){
349            if($timescale_p1!=$timescale_p2 )
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
331       for($adapt=0;$adapt<$adapt_count;$adapt++)
329    for($i=0;$i<($period_count-1);$i++)
329    for($i=0;$i<($period_count-1);$i++)
355    return $errorMsg;
356}
checkTrackIDChangeSplicePoint
290function checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
291{
292    $errorMsg="";
293    $period_count=sizeof($MediaProfDatabase);
294    $adapt_count=sizeof($MediaProfDatabase[0]);
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
321    return $errorMsg;
322}
290function checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
291{
292    $errorMsg="";
293    $period_count=sizeof($MediaProfDatabase);
294    $adapt_count=sizeof($MediaProfDatabase[0]);
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
321    return $errorMsg;
322}
290function checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
291{
292    $errorMsg="";
293    $period_count=sizeof($MediaProfDatabase);
294    $adapt_count=sizeof($MediaProfDatabase[0]);
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
303                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd");
304                if($tkhd->length>0)
305                  $trackID_p1=$tkhd->item(0)->getAttribute("trackID");
306               
307            }
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
310                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd");
311                if($tkhd->length>0)
312                  $trackID_p2=$tkhd->item(0)->getAttribute("trackID");
313
314            }
315            if($trackID_p1!=$trackID_p2 )
315            if($trackID_p1!=$trackID_p2 )
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
298        {
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
303                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd");
304                if($tkhd->length>0)
305                  $trackID_p1=$tkhd->item(0)->getAttribute("trackID");
306               
307            }
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
310                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd");
311                if($tkhd->length>0)
312                  $trackID_p2=$tkhd->item(0)->getAttribute("trackID");
313
314            }
315            if($trackID_p1!=$trackID_p2 )
316                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Track_ID can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with TrackID -".$trackID_p1." and ".$trackID_p2." respectively.\n";
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
321    return $errorMsg;
322}
290function checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
291{
292    $errorMsg="";
293    $period_count=sizeof($MediaProfDatabase);
294    $adapt_count=sizeof($MediaProfDatabase[0]);
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
303                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd");
304                if($tkhd->length>0)
305                  $trackID_p1=$tkhd->item(0)->getAttribute("trackID");
306               
307            }
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
310                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd");
311                if($tkhd->length>0)
312                  $trackID_p2=$tkhd->item(0)->getAttribute("trackID");
313
314            }
315            if($trackID_p1!=$trackID_p2 )
315            if($trackID_p1!=$trackID_p2 )
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
321    return $errorMsg;
322}
290function checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
291{
292    $errorMsg="";
293    $period_count=sizeof($MediaProfDatabase);
294    $adapt_count=sizeof($MediaProfDatabase[0]);
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
303                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd");
304                if($tkhd->length>0)
305                  $trackID_p1=$tkhd->item(0)->getAttribute("trackID");
306               
307            }
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
310                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd");
311                if($tkhd->length>0)
315            if($trackID_p1!=$trackID_p2 )
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
298        {
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
303                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd");
304                if($tkhd->length>0)
305                  $trackID_p1=$tkhd->item(0)->getAttribute("trackID");
306               
307            }
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
310                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd");
311                if($tkhd->length>0)
312                  $trackID_p2=$tkhd->item(0)->getAttribute("trackID");
313
314            }
315            if($trackID_p1!=$trackID_p2 )
316                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Track_ID can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with TrackID -".$trackID_p1." and ".$trackID_p2." respectively.\n";
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
321    return $errorMsg;
322}
290function checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
291{
292    $errorMsg="";
293    $period_count=sizeof($MediaProfDatabase);
294    $adapt_count=sizeof($MediaProfDatabase[0]);
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
303                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd");
304                if($tkhd->length>0)
305                  $trackID_p1=$tkhd->item(0)->getAttribute("trackID");
306               
307            }
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
310                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd");
311                if($tkhd->length>0)
315            if($trackID_p1!=$trackID_p2 )
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
321    return $errorMsg;
322}
290function checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
291{
292    $errorMsg="";
293    $period_count=sizeof($MediaProfDatabase);
294    $adapt_count=sizeof($MediaProfDatabase[0]);
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
303                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd");
304                if($tkhd->length>0)
305                  $trackID_p1=$tkhd->item(0)->getAttribute("trackID");
306               
307            }
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
315            if($trackID_p1!=$trackID_p2 )
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
298        {
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
303                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd");
304                if($tkhd->length>0)
305                  $trackID_p1=$tkhd->item(0)->getAttribute("trackID");
306               
307            }
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
310                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd");
311                if($tkhd->length>0)
312                  $trackID_p2=$tkhd->item(0)->getAttribute("trackID");
313
314            }
315            if($trackID_p1!=$trackID_p2 )
316                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Track_ID can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with TrackID -".$trackID_p1." and ".$trackID_p2." respectively.\n";
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
321    return $errorMsg;
322}
290function checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
291{
292    $errorMsg="";
293    $period_count=sizeof($MediaProfDatabase);
294    $adapt_count=sizeof($MediaProfDatabase[0]);
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
303                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd");
304                if($tkhd->length>0)
305                  $trackID_p1=$tkhd->item(0)->getAttribute("trackID");
306               
307            }
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
315            if($trackID_p1!=$trackID_p2 )
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
321    return $errorMsg;
322}
290function checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
291{
292    $errorMsg="";
293    $period_count=sizeof($MediaProfDatabase);
294    $adapt_count=sizeof($MediaProfDatabase[0]);
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
303                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd");
304                if($tkhd->length>0)
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
310                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd");
311                if($tkhd->length>0)
312                  $trackID_p2=$tkhd->item(0)->getAttribute("trackID");
313
314            }
315            if($trackID_p1!=$trackID_p2 )
315            if($trackID_p1!=$trackID_p2 )
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
298        {
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
303                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd");
304                if($tkhd->length>0)
305                  $trackID_p1=$tkhd->item(0)->getAttribute("trackID");
306               
307            }
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
310                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd");
311                if($tkhd->length>0)
312                  $trackID_p2=$tkhd->item(0)->getAttribute("trackID");
313
314            }
315            if($trackID_p1!=$trackID_p2 )
316                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Track_ID can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with TrackID -".$trackID_p1." and ".$trackID_p2." respectively.\n";
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
321    return $errorMsg;
322}
290function checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
291{
292    $errorMsg="";
293    $period_count=sizeof($MediaProfDatabase);
294    $adapt_count=sizeof($MediaProfDatabase[0]);
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
303                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd");
304                if($tkhd->length>0)
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
310                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd");
311                if($tkhd->length>0)
312                  $trackID_p2=$tkhd->item(0)->getAttribute("trackID");
313
314            }
315            if($trackID_p1!=$trackID_p2 )
315            if($trackID_p1!=$trackID_p2 )
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
321    return $errorMsg;
322}
290function checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
291{
292    $errorMsg="";
293    $period_count=sizeof($MediaProfDatabase);
294    $adapt_count=sizeof($MediaProfDatabase[0]);
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
303                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd");
304                if($tkhd->length>0)
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
310                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd");
311                if($tkhd->length>0)
315            if($trackID_p1!=$trackID_p2 )
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
298        {
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
303                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd");
304                if($tkhd->length>0)
305                  $trackID_p1=$tkhd->item(0)->getAttribute("trackID");
306               
307            }
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
310                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd");
311                if($tkhd->length>0)
312                  $trackID_p2=$tkhd->item(0)->getAttribute("trackID");
313
314            }
315            if($trackID_p1!=$trackID_p2 )
316                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Track_ID can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with TrackID -".$trackID_p1." and ".$trackID_p2." respectively.\n";
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
321    return $errorMsg;
322}
290function checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
291{
292    $errorMsg="";
293    $period_count=sizeof($MediaProfDatabase);
294    $adapt_count=sizeof($MediaProfDatabase[0]);
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
303                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd");
304                if($tkhd->length>0)
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
310                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd");
311                if($tkhd->length>0)
315            if($trackID_p1!=$trackID_p2 )
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
321    return $errorMsg;
322}
290function checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
291{
292    $errorMsg="";
293    $period_count=sizeof($MediaProfDatabase);
294    $adapt_count=sizeof($MediaProfDatabase[0]);
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
303                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd");
304                if($tkhd->length>0)
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
315            if($trackID_p1!=$trackID_p2 )
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
298        {
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
303                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd");
304                if($tkhd->length>0)
305                  $trackID_p1=$tkhd->item(0)->getAttribute("trackID");
306               
307            }
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
310                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd");
311                if($tkhd->length>0)
312                  $trackID_p2=$tkhd->item(0)->getAttribute("trackID");
313
314            }
315            if($trackID_p1!=$trackID_p2 )
316                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Track_ID can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with TrackID -".$trackID_p1." and ".$trackID_p2." respectively.\n";
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
321    return $errorMsg;
322}
290function checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
291{
292    $errorMsg="";
293    $period_count=sizeof($MediaProfDatabase);
294    $adapt_count=sizeof($MediaProfDatabase[0]);
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
303                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd");
304                if($tkhd->length>0)
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
315            if($trackID_p1!=$trackID_p2 )
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
321    return $errorMsg;
322}
290function checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
291{
292    $errorMsg="";
293    $period_count=sizeof($MediaProfDatabase);
294    $adapt_count=sizeof($MediaProfDatabase[0]);
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
310                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd");
311                if($tkhd->length>0)
312                  $trackID_p2=$tkhd->item(0)->getAttribute("trackID");
313
314            }
315            if($trackID_p1!=$trackID_p2 )
315            if($trackID_p1!=$trackID_p2 )
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
298        {
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
303                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd");
304                if($tkhd->length>0)
305                  $trackID_p1=$tkhd->item(0)->getAttribute("trackID");
306               
307            }
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
310                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd");
311                if($tkhd->length>0)
312                  $trackID_p2=$tkhd->item(0)->getAttribute("trackID");
313
314            }
315            if($trackID_p1!=$trackID_p2 )
316                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Track_ID can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with TrackID -".$trackID_p1." and ".$trackID_p2." respectively.\n";
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
321    return $errorMsg;
322}
290function checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
291{
292    $errorMsg="";
293    $period_count=sizeof($MediaProfDatabase);
294    $adapt_count=sizeof($MediaProfDatabase[0]);
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
310                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd");
311                if($tkhd->length>0)
312                  $trackID_p2=$tkhd->item(0)->getAttribute("trackID");
313
314            }
315            if($trackID_p1!=$trackID_p2 )
315            if($trackID_p1!=$trackID_p2 )
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
321    return $errorMsg;
322}
290function checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
291{
292    $errorMsg="";
293    $period_count=sizeof($MediaProfDatabase);
294    $adapt_count=sizeof($MediaProfDatabase[0]);
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
310                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd");
311                if($tkhd->length>0)
315            if($trackID_p1!=$trackID_p2 )
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
298        {
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
303                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd");
304                if($tkhd->length>0)
305                  $trackID_p1=$tkhd->item(0)->getAttribute("trackID");
306               
307            }
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
310                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd");
311                if($tkhd->length>0)
312                  $trackID_p2=$tkhd->item(0)->getAttribute("trackID");
313
314            }
315            if($trackID_p1!=$trackID_p2 )
316                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Track_ID can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with TrackID -".$trackID_p1." and ".$trackID_p2." respectively.\n";
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
321    return $errorMsg;
322}
290function checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
291{
292    $errorMsg="";
293    $period_count=sizeof($MediaProfDatabase);
294    $adapt_count=sizeof($MediaProfDatabase[0]);
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
310                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd");
311                if($tkhd->length>0)
315            if($trackID_p1!=$trackID_p2 )
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
321    return $errorMsg;
322}
290function checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
291{
292    $errorMsg="";
293    $period_count=sizeof($MediaProfDatabase);
294    $adapt_count=sizeof($MediaProfDatabase[0]);
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
315            if($trackID_p1!=$trackID_p2 )
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
298        {
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
303                $tkhd=$xml_rep_P1->getElementsByTagName("tkhd");
304                if($tkhd->length>0)
305                  $trackID_p1=$tkhd->item(0)->getAttribute("trackID");
306               
307            }
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
310                $tkhd=$xml_rep_P2->getElementsByTagName("tkhd");
311                if($tkhd->length>0)
312                  $trackID_p2=$tkhd->item(0)->getAttribute("trackID");
313
314            }
315            if($trackID_p1!=$trackID_p2 )
316                    $errorMsg="Information: WAVE Content Spec 2018Ed-Section 7.2.2: 'Track_ID can change at Splice points', change is observed for Sw set ".$adapt." between CMAF Presentations ".$i." and  ".($i+1)." with TrackID -".$trackID_p1." and ".$trackID_p2." respectively.\n";
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
321    return $errorMsg;
322}
290function checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template)
291{
292    $errorMsg="";
293    $period_count=sizeof($MediaProfDatabase);
294    $adapt_count=sizeof($MediaProfDatabase[0]);
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
299            $adapt_dir = str_replace('$AS$', $adapt, $adaptation_set_template);
300            $rep_dir = str_replace(array('$AS$', '$R$'), array($adapt, 0), $reprsentation_template);
301            $xml_rep_P1 = get_DOM($session_dir.'/Period'.$i.'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
302            if($xml_rep_P1){
308           $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
309            if($xml_rep_P2){
315            if($trackID_p1!=$trackID_p2 )
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
297       for($adapt=0;$adapt<$adapt_count;$adapt++)
295    for($i=0;$i<($period_count-1);$i++)
295    for($i=0;$i<($period_count-1);$i++)
321    return $errorMsg;
322}
getEncrytionScheme
197function getEncrytionScheme($xml)
198{
199     //Check for encrypted tracks
200    if($xml->getElementsByTagName('tenc')->length >0)
202        $schm=$xml->getElementsByTagName('schm');
203        if($schm->length>0)
204             return $schm->item(0)->getAttribute('scheme');
197function getEncrytionScheme($xml)
198{
199     //Check for encrypted tracks
200    if($xml->getElementsByTagName('tenc')->length >0)
202        $schm=$xml->getElementsByTagName('schm');
203        if($schm->length>0)
204             return $schm->item(0)->getAttribute('scheme');
208}
197function getEncrytionScheme($xml)
198{
199     //Check for encrypted tracks
200    if($xml->getElementsByTagName('tenc')->length >0)
207        return 0;
getFrameRate
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
493        $nal_unit=$xml->getElementsByTagName("NALUnit");
494        if($nal_unit->length==0){
495          $framerate=0;
515                    $framerate=$time_scale/(2*$num_units_in_tick);
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
493        $nal_unit=$xml->getElementsByTagName("NALUnit");
494        if($nal_unit->length==0){
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
506            $comment=$nal_unit->item($sps_unit)->getElementsByTagName("comment")->item(0);  
507
508
509            if($comment->getAttribute("vui_parameters_present_flag")=="0x1")
511                if($comment->getAttribute("timing_info_present_flag")=="0x1" )
513                    $num_units_in_tick=$comment->getAttribute("num_units_in_tick");
514                    $time_scale=$comment->getAttribute("time_scale");
515                    $framerate=$time_scale/(2*$num_units_in_tick);
515                    $framerate=$time_scale/(2*$num_units_in_tick);
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
493        $nal_unit=$xml->getElementsByTagName("NALUnit");
494        if($nal_unit->length==0){
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
506            $comment=$nal_unit->item($sps_unit)->getElementsByTagName("comment")->item(0);  
507
508
509            if($comment->getAttribute("vui_parameters_present_flag")=="0x1")
511                if($comment->getAttribute("timing_info_present_flag")=="0x1" )
515                    $framerate=$time_scale/(2*$num_units_in_tick);
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
493        $nal_unit=$xml->getElementsByTagName("NALUnit");
494        if($nal_unit->length==0){
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
506            $comment=$nal_unit->item($sps_unit)->getElementsByTagName("comment")->item(0);  
507
508
509            if($comment->getAttribute("vui_parameters_present_flag")=="0x1")
515                    $framerate=$time_scale/(2*$num_units_in_tick);
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
493        $nal_unit=$xml->getElementsByTagName("NALUnit");
494        if($nal_unit->length==0){
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
500                if($nal_unit->item($nal_count)->getAttribute("nal_type")=="0x07")
501                {    $sps_unit=$nal_count;
502                     break;
506            $comment=$nal_unit->item($sps_unit)->getElementsByTagName("comment")->item(0);  
507
508
509            if($comment->getAttribute("vui_parameters_present_flag")=="0x1")
511                if($comment->getAttribute("timing_info_present_flag")=="0x1" )
513                    $num_units_in_tick=$comment->getAttribute("num_units_in_tick");
514                    $time_scale=$comment->getAttribute("time_scale");
515                    $framerate=$time_scale/(2*$num_units_in_tick);
515                    $framerate=$time_scale/(2*$num_units_in_tick);
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
493        $nal_unit=$xml->getElementsByTagName("NALUnit");
494        if($nal_unit->length==0){
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
500                if($nal_unit->item($nal_count)->getAttribute("nal_type")=="0x07")
501                {    $sps_unit=$nal_count;
502                     break;
506            $comment=$nal_unit->item($sps_unit)->getElementsByTagName("comment")->item(0);  
507
508
509            if($comment->getAttribute("vui_parameters_present_flag")=="0x1")
511                if($comment->getAttribute("timing_info_present_flag")=="0x1" )
515                    $framerate=$time_scale/(2*$num_units_in_tick);
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
493        $nal_unit=$xml->getElementsByTagName("NALUnit");
494        if($nal_unit->length==0){
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
500                if($nal_unit->item($nal_count)->getAttribute("nal_type")=="0x07")
501                {    $sps_unit=$nal_count;
502                     break;
506            $comment=$nal_unit->item($sps_unit)->getElementsByTagName("comment")->item(0);  
507
508
509            if($comment->getAttribute("vui_parameters_present_flag")=="0x1")
515                    $framerate=$time_scale/(2*$num_units_in_tick);
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
493        $nal_unit=$xml->getElementsByTagName("NALUnit");
494        if($nal_unit->length==0){
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
500                if($nal_unit->item($nal_count)->getAttribute("nal_type")=="0x07")
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
506            $comment=$nal_unit->item($sps_unit)->getElementsByTagName("comment")->item(0);  
507
508
509            if($comment->getAttribute("vui_parameters_present_flag")=="0x1")
511                if($comment->getAttribute("timing_info_present_flag")=="0x1" )
513                    $num_units_in_tick=$comment->getAttribute("num_units_in_tick");
514                    $time_scale=$comment->getAttribute("time_scale");
515                    $framerate=$time_scale/(2*$num_units_in_tick);
515                    $framerate=$time_scale/(2*$num_units_in_tick);
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
493        $nal_unit=$xml->getElementsByTagName("NALUnit");
494        if($nal_unit->length==0){
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
500                if($nal_unit->item($nal_count)->getAttribute("nal_type")=="0x07")
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
506            $comment=$nal_unit->item($sps_unit)->getElementsByTagName("comment")->item(0);  
507
508
509            if($comment->getAttribute("vui_parameters_present_flag")=="0x1")
511                if($comment->getAttribute("timing_info_present_flag")=="0x1" )
515                    $framerate=$time_scale/(2*$num_units_in_tick);
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
493        $nal_unit=$xml->getElementsByTagName("NALUnit");
494        if($nal_unit->length==0){
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
500                if($nal_unit->item($nal_count)->getAttribute("nal_type")=="0x07")
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
506            $comment=$nal_unit->item($sps_unit)->getElementsByTagName("comment")->item(0);  
507
508
509            if($comment->getAttribute("vui_parameters_present_flag")=="0x1")
515                    $framerate=$time_scale/(2*$num_units_in_tick);
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
525            $framerate=0;
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
541                  $num_units_in_tick=$sps->getAttribute("vui_num_units_in_tick");
542                  $time_scale=$sps->getAttribute("vui_time_scale");
543                  $framerate=$time_scale/($num_units_in_tick);
544              }
545            }
546        }
547    }
548    return $framerate;
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
531                {    $sps_unit=$nal_count;
532                     break;
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
541                  $num_units_in_tick=$sps->getAttribute("vui_num_units_in_tick");
542                  $time_scale=$sps->getAttribute("vui_time_scale");
543                  $framerate=$time_scale/($num_units_in_tick);
544              }
545            }
546        }
547    }
548    return $framerate;
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
531                {    $sps_unit=$nal_count;
532                     break;
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
531                {    $sps_unit=$nal_count;
532                     break;
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
541                  $num_units_in_tick=$sps->getAttribute("vui_num_units_in_tick");
542                  $time_scale=$sps->getAttribute("vui_time_scale");
543                  $framerate=$time_scale/($num_units_in_tick);
544              }
545            }
546        }
547    }
548    return $framerate;
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
525            $framerate=0;
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
541                  $num_units_in_tick=$sps->getAttribute("vui_num_units_in_tick");
542                  $time_scale=$sps->getAttribute("vui_time_scale");
543                  $framerate=$time_scale/($num_units_in_tick);
544              }
545            }
546        }
547    }
548    return $framerate;
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
531                {    $sps_unit=$nal_count;
532                     break;
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
541                  $num_units_in_tick=$sps->getAttribute("vui_num_units_in_tick");
542                  $time_scale=$sps->getAttribute("vui_time_scale");
543                  $framerate=$time_scale/($num_units_in_tick);
544              }
545            }
546        }
547    }
548    return $framerate;
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
531                {    $sps_unit=$nal_count;
532                     break;
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
531                {    $sps_unit=$nal_count;
532                     break;
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
541                  $num_units_in_tick=$sps->getAttribute("vui_num_units_in_tick");
542                  $time_scale=$sps->getAttribute("vui_time_scale");
543                  $framerate=$time_scale/($num_units_in_tick);
544              }
545            }
546        }
547    }
548    return $framerate;
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
493        $nal_unit=$xml->getElementsByTagName("NALUnit");
494        if($nal_unit->length==0){
495          $framerate=0;
515                    $framerate=$time_scale/(2*$num_units_in_tick);
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
493        $nal_unit=$xml->getElementsByTagName("NALUnit");
494        if($nal_unit->length==0){
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
506            $comment=$nal_unit->item($sps_unit)->getElementsByTagName("comment")->item(0);  
507
508
509            if($comment->getAttribute("vui_parameters_present_flag")=="0x1")
511                if($comment->getAttribute("timing_info_present_flag")=="0x1" )
513                    $num_units_in_tick=$comment->getAttribute("num_units_in_tick");
514                    $time_scale=$comment->getAttribute("time_scale");
515                    $framerate=$time_scale/(2*$num_units_in_tick);
515                    $framerate=$time_scale/(2*$num_units_in_tick);
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
493        $nal_unit=$xml->getElementsByTagName("NALUnit");
494        if($nal_unit->length==0){
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
506            $comment=$nal_unit->item($sps_unit)->getElementsByTagName("comment")->item(0);  
507
508
509            if($comment->getAttribute("vui_parameters_present_flag")=="0x1")
511                if($comment->getAttribute("timing_info_present_flag")=="0x1" )
515                    $framerate=$time_scale/(2*$num_units_in_tick);
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
493        $nal_unit=$xml->getElementsByTagName("NALUnit");
494        if($nal_unit->length==0){
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
506            $comment=$nal_unit->item($sps_unit)->getElementsByTagName("comment")->item(0);  
507
508
509            if($comment->getAttribute("vui_parameters_present_flag")=="0x1")
515                    $framerate=$time_scale/(2*$num_units_in_tick);
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
493        $nal_unit=$xml->getElementsByTagName("NALUnit");
494        if($nal_unit->length==0){
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
500                if($nal_unit->item($nal_count)->getAttribute("nal_type")=="0x07")
501                {    $sps_unit=$nal_count;
502                     break;
506            $comment=$nal_unit->item($sps_unit)->getElementsByTagName("comment")->item(0);  
507
508
509            if($comment->getAttribute("vui_parameters_present_flag")=="0x1")
511                if($comment->getAttribute("timing_info_present_flag")=="0x1" )
513                    $num_units_in_tick=$comment->getAttribute("num_units_in_tick");
514                    $time_scale=$comment->getAttribute("time_scale");
515                    $framerate=$time_scale/(2*$num_units_in_tick);
515                    $framerate=$time_scale/(2*$num_units_in_tick);
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
493        $nal_unit=$xml->getElementsByTagName("NALUnit");
494        if($nal_unit->length==0){
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
500                if($nal_unit->item($nal_count)->getAttribute("nal_type")=="0x07")
501                {    $sps_unit=$nal_count;
502                     break;
506            $comment=$nal_unit->item($sps_unit)->getElementsByTagName("comment")->item(0);  
507
508
509            if($comment->getAttribute("vui_parameters_present_flag")=="0x1")
511                if($comment->getAttribute("timing_info_present_flag")=="0x1" )
515                    $framerate=$time_scale/(2*$num_units_in_tick);
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
493        $nal_unit=$xml->getElementsByTagName("NALUnit");
494        if($nal_unit->length==0){
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
500                if($nal_unit->item($nal_count)->getAttribute("nal_type")=="0x07")
501                {    $sps_unit=$nal_count;
502                     break;
506            $comment=$nal_unit->item($sps_unit)->getElementsByTagName("comment")->item(0);  
507
508
509            if($comment->getAttribute("vui_parameters_present_flag")=="0x1")
515                    $framerate=$time_scale/(2*$num_units_in_tick);
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
493        $nal_unit=$xml->getElementsByTagName("NALUnit");
494        if($nal_unit->length==0){
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
500                if($nal_unit->item($nal_count)->getAttribute("nal_type")=="0x07")
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
506            $comment=$nal_unit->item($sps_unit)->getElementsByTagName("comment")->item(0);  
507
508
509            if($comment->getAttribute("vui_parameters_present_flag")=="0x1")
511                if($comment->getAttribute("timing_info_present_flag")=="0x1" )
513                    $num_units_in_tick=$comment->getAttribute("num_units_in_tick");
514                    $time_scale=$comment->getAttribute("time_scale");
515                    $framerate=$time_scale/(2*$num_units_in_tick);
515                    $framerate=$time_scale/(2*$num_units_in_tick);
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
493        $nal_unit=$xml->getElementsByTagName("NALUnit");
494        if($nal_unit->length==0){
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
500                if($nal_unit->item($nal_count)->getAttribute("nal_type")=="0x07")
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
506            $comment=$nal_unit->item($sps_unit)->getElementsByTagName("comment")->item(0);  
507
508
509            if($comment->getAttribute("vui_parameters_present_flag")=="0x1")
511                if($comment->getAttribute("timing_info_present_flag")=="0x1" )
515                    $framerate=$time_scale/(2*$num_units_in_tick);
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
493        $nal_unit=$xml->getElementsByTagName("NALUnit");
494        if($nal_unit->length==0){
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
500                if($nal_unit->item($nal_count)->getAttribute("nal_type")=="0x07")
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
498            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
506            $comment=$nal_unit->item($sps_unit)->getElementsByTagName("comment")->item(0);  
507
508
509            if($comment->getAttribute("vui_parameters_present_flag")=="0x1")
515                    $framerate=$time_scale/(2*$num_units_in_tick);
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
525            $framerate=0;
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
541                  $num_units_in_tick=$sps->getAttribute("vui_num_units_in_tick");
542                  $time_scale=$sps->getAttribute("vui_time_scale");
543                  $framerate=$time_scale/($num_units_in_tick);
544              }
545            }
546        }
547    }
548    return $framerate;
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
531                {    $sps_unit=$nal_count;
532                     break;
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
541                  $num_units_in_tick=$sps->getAttribute("vui_num_units_in_tick");
542                  $time_scale=$sps->getAttribute("vui_time_scale");
543                  $framerate=$time_scale/($num_units_in_tick);
544              }
545            }
546        }
547    }
548    return $framerate;
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
531                {    $sps_unit=$nal_count;
532                     break;
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
531                {    $sps_unit=$nal_count;
532                     break;
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
541                  $num_units_in_tick=$sps->getAttribute("vui_num_units_in_tick");
542                  $time_scale=$sps->getAttribute("vui_time_scale");
543                  $framerate=$time_scale/($num_units_in_tick);
544              }
545            }
546        }
547    }
548    return $framerate;
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
525            $framerate=0;
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
541                  $num_units_in_tick=$sps->getAttribute("vui_num_units_in_tick");
542                  $time_scale=$sps->getAttribute("vui_time_scale");
543                  $framerate=$time_scale/($num_units_in_tick);
544              }
545            }
546        }
547    }
548    return $framerate;
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
531                {    $sps_unit=$nal_count;
532                     break;
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
541                  $num_units_in_tick=$sps->getAttribute("vui_num_units_in_tick");
542                  $time_scale=$sps->getAttribute("vui_time_scale");
543                  $framerate=$time_scale/($num_units_in_tick);
544              }
545            }
546        }
547    }
548    return $framerate;
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
531                {    $sps_unit=$nal_count;
532                     break;
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
531                {    $sps_unit=$nal_count;
532                     break;
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
541                  $num_units_in_tick=$sps->getAttribute("vui_num_units_in_tick");
542                  $time_scale=$sps->getAttribute("vui_time_scale");
543                  $framerate=$time_scale/($num_units_in_tick);
544              }
545            }
546        }
547    }
548    return $framerate;
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
539              if($sps->getAttribute("vui_timing_info_present_flag")=="1" )
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
523        $nal_unit=$xml->getElementsByTagName("NALUnit");
524        if($nal_unit->length==0){
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
530                if($nal_unit->item($nal_count)->getAttribute("nal_unit_type")=="33")
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
528            for($nal_count=0;$nal_count<$nal_unit->length;$nal_count++)
536            $sps=$nal_unit->item($sps_unit);
537            if($sps->getAttribute("vui_parameters_present_flag")=="1")
548    return $framerate;
549}
487function getFrameRate($xml)
488{
489    $videSampleDes=$xml->getElementsByTagName("vide_sampledescription")->item(0);
490    $sdType=$videSampleDes->getAttribute("sdType");
491    if($sdType=='avc1' || $sdType=='avc3')
491    if($sdType=='avc1' || $sdType=='avc3')
520    else if($sdType=='hev1' || $sdType=='hvc1')
520    else if($sdType=='hev1' || $sdType=='hvc1')
548    return $framerate;
549}
getSdType
240function getSdType($xml)
241{
242    $sdType=0;$SampleDescr="";
243    $hdlr=$xml->getElementsByTagName("hdlr")->item(0);
244    $handler_type=$hdlr->getAttribute("handler_type");
245    if($handler_type=="vide")
246        $SampleDescr=$xml->getElementsByTagName("vide_sampledescription")->item(0);
249    if($SampleDescr!=="")
250        $sdType=$SampleDescr->getAttribute("sdType");
251    
252    return $sdType;
252    return $sdType;
253}
240function getSdType($xml)
241{
242    $sdType=0;$SampleDescr="";
243    $hdlr=$xml->getElementsByTagName("hdlr")->item(0);
244    $handler_type=$hdlr->getAttribute("handler_type");
245    if($handler_type=="vide")
246        $SampleDescr=$xml->getElementsByTagName("vide_sampledescription")->item(0);
249    if($SampleDescr!=="")
252    return $sdType;
253}
240function getSdType($xml)
241{
242    $sdType=0;$SampleDescr="";
243    $hdlr=$xml->getElementsByTagName("hdlr")->item(0);
244    $handler_type=$hdlr->getAttribute("handler_type");
245    if($handler_type=="vide")
247    elseif($handler_type=="soun")
248        $SampleDescr=$xml->getElementsByTagName("soun_sampledescription")->item(0);
249    if($SampleDescr!=="")
249    if($SampleDescr!=="")
250        $sdType=$SampleDescr->getAttribute("sdType");
251    
252    return $sdType;
252    return $sdType;
253}
240function getSdType($xml)
241{
242    $sdType=0;$SampleDescr="";
243    $hdlr=$xml->getElementsByTagName("hdlr")->item(0);
244    $handler_type=$hdlr->getAttribute("handler_type");
245    if($handler_type=="vide")
247    elseif($handler_type=="soun")
248        $SampleDescr=$xml->getElementsByTagName("soun_sampledescription")->item(0);
249    if($SampleDescr!=="")
249    if($SampleDescr!=="")
252    return $sdType;
253}
240function getSdType($xml)
241{
242    $sdType=0;$SampleDescr="";
243    $hdlr=$xml->getElementsByTagName("hdlr")->item(0);
244    $handler_type=$hdlr->getAttribute("handler_type");
245    if($handler_type=="vide")
247    elseif($handler_type=="soun")
249    if($SampleDescr!=="")
250        $sdType=$SampleDescr->getAttribute("sdType");
251    
252    return $sdType;
252    return $sdType;
253}
240function getSdType($xml)
241{
242    $sdType=0;$SampleDescr="";
243    $hdlr=$xml->getElementsByTagName("hdlr")->item(0);
244    $handler_type=$hdlr->getAttribute("handler_type");
245    if($handler_type=="vide")
247    elseif($handler_type=="soun")
249    if($SampleDescr!=="")
252    return $sdType;
253}